{"id":251,"date":"2009-08-20T06:57:54","date_gmt":"2009-08-20T06:57:54","guid":{"rendered":"http:\/\/tw.newtonstudio.com\/?p=251"},"modified":"2009-08-20T10:03:24","modified_gmt":"2009-08-20T10:03:24","slug":"rdata-clustering","status":"publish","type":"post","link":"http:\/\/tw.newtonstudio.com\/?p=251","title":{"rendered":"[R]Data Clustering"},"content":{"rendered":"<p>\u8b1b\u5e2b: <a href=\"http:\/\/www.bime.ntu.edu.tw\/teacher\/info\/prof28.html\">\u9673\u5029\u745c<\/a><\/p>\n<p>Feature Selection \u8ab2\u7a0b\u7d44\u7e54<br \/>\n\u5c6c\u6027\u7684\u9078\u64c7<\/p>\n<p>Clustering:\u5206\u7fa4<br \/>\n(Unsupervised Learning)<\/p>\n<p>Classification: \u5206\u985e<br \/>\n(Supervised Learning)<\/p>\n<p>\u9019\u5802\u8ab2\u7684\u5927\u92fc\u6703\u6bd4\u8f03\u6db5\u84cb\u5728\u6f14\u7b97\u6cd5\u4e0a, \u4e00\u4e9b\u51fd\u6578\u7684\u80cc\u666f\u7406\u8ad6\u8207\u61c9\u7528.<\/p>\n<p>\u9996\u5148\u5047\u8a2d\u6211\u5011\u62ff\u5230\u7684\u8cc7\u6599\u5df2\u7d93\u7d93\u904e\u6574\u7406,<br \/>\n\u4f86\u81ea\u4e0d\u540c\u75c5\u4eba\u7684\u8cc7\u6599\u6574\u7406\u6210\u4e00\u500b\u4e8c\u7dad\u7684\u9663\u5217.<\/p>\n<pre>\u7e31\u8ef8\u53ef\u80fd\u662f \u6642\u9593\u7684\u5dee\u7570, Condition,\r\n----------------------------------------\r\n| sample |\r\n----------------------------------------\r\n| gene1  |\r\n----------------------------------------\r\n| gene2  |\r\n----------------------------------------<\/pre>\n<p>\u82e5\u4f5cclustering, \u5c6c\u6027\u76f8\u540c\u7684\u6703\u88ab\u6b78\u985e\u5728\u4e00\u8d77.Data Clustering concerns how to group similar objects together while spearating dissimilar objects.\u5982\u4f55\u5224\u65b7\u884c\u4e0d\u884c? \u7576\u4f60\u62ff\u5230\u4e00\u7fa4\u8cc7\u6599\u7684\u6642\u5019, \u5c31\u53ef\u4ee5\u5f9e\u4e00\u5927\u7fa4\u8cc7\u6599\u53bb\u5224\u65b7\u6709\u751a\u9ebc\u95dc\u9023\u6027, \u4ee5\u53ca\u5982\u4f55\u5206\u7fa4.<\/p>\n<p>\u9019\u6a23\u7684\u65b9\u6cd5\u5728\u5f88\u591a\u5730\u65b9\u90fd\u6709\u7528\u5230, \u5982: machine learning, Data mining, Pattern recognition, Image Analysis, Bioinformatics.<\/p>\n<p>Hierarchical<br \/>\nhttp:\/\/en.wikipedia.org\/wiki\/Cluster_analysis<br \/>\nhttp:\/\/nlp.stanford.edu\/IR-book\/html\/htmledition\/hierarchical-agglomerative-clustering-1.html<br \/>\n\u5de2\u72c0\u5f0f,<br \/>\n\u968e\u5c64\u5f0f (\u61c9\u7528\u5728\u57fa\u56e0\u7684\u6982\u5ff5\u4e0a)<\/p>\n<p>Agglomerative<br \/>\nDivisive<br \/>\nHAC (hierarchical agglomerative clustering) \u5148\u628a\u50cf\u7684\u6771\u897f\u653e\u5728\u4e00\u8d77, \u6c7a\u5b9a\u7b2c\u4e00\u5200\u5207\u5728\u54ea\u88e1.<\/p>\n<p>\u65b9\u6cd5\u5982\u4e0b:<\/p>\n<p>1. \u5148\u6c7a\u5b9a\u5169\u500b\u4eba\u7684\u76f8\u4f3c\u7a0b\u5ea6, \u6bd4\u5982: A\u670925000\u500bFEATURE, B\u670925000\u500bFEATURE<\/p>\n<p>Proximity matrix containing the distance between each pair of objects. Treat each object as\u00a0 cluster.<\/p>\n<p>2. \u628a\u5169\u500b\u6700\u50cf\u7684\u6771\u897f\u653e\u5728\u4e00\u8d77, UPDATE \u525b\u525b\u7684MATRIX<\/p>\n<blockquote><p>&gt; class(iris)<br \/>\n[1] &#8220;data.frame&#8221;<br \/>\n&gt; dim(iris)<br \/>\n[1] 150\u00a0\u00a0 5<br \/>\n&gt; class(iris[1])<br \/>\n[1] &#8220;data.frame&#8221;<br \/>\n&gt; class(iris[2])<br \/>\n[1] &#8220;data.frame&#8221;<br \/>\n&gt; class(iris[4])<br \/>\n[1] &#8220;data.frame&#8221;<br \/>\n&gt; class(iris[,1])<br \/>\n[1] &#8220;numeric&#8221;<br \/>\n&gt; class(iris[,2])<br \/>\n[1] &#8220;numeric&#8221;<br \/>\n&gt; class(iris[,6])<br \/>\n\u932f\u8aa4\u5728`[.data.frame`(iris, , 6) : undefined columns selected<br \/>\n&gt; class(iris[,5])<br \/>\n[1] &#8220;factor&#8221;<br \/>\n&gt; table(iris[,5])<\/p>\n<p>setosa versicolor\u00a0 virginica<br \/>\n50\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 50\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 50<\/p><\/blockquote>\n<p><a href=\"http:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2009\/08\/irisplot.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-259 alignleft\" style=\"margin: 10px;\" title=\"irisplot\" src=\"http:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2009\/08\/irisplot-193x300.jpg\" alt=\"\" width=\"195\" height=\"190\" \/><\/a><\/p>\n<p>\u7528 Iris \u4f86\u7e6a\u5716 &gt; plot(iris[1:4], col=iris[,5]) ,<\/p>\n<p>\u984f\u8272\u8868\u793a\u4ee5\u7b2c\u4e94\u500b\u6b04\u4f4d\u4f86\u5206\u985e(\u56e0\u70ba\u6709\u4e09\u500bcategory,\u6240\u4ee5\u6709\u4e09\u7a2e\u984f\u8272)<\/p>\n<p>\u5206\u7fa4\u5e38\u7528\u6307\u4ee4:<\/p>\n<blockquote><p><strong>&gt; h &lt;- agnes(iris[3:4])<br \/>\n&gt; h<\/strong><br \/>\nCall:\u00a0\u00a0\u00a0 agnes(x = iris[3:4])<br \/>\nAgglomerative coefficient:\u00a0 0.9791964<br \/>\nOrder of objects:<br \/>\n[1]\u00a0\u00a0 1\u00a0\u00a0 2\u00a0\u00a0 5\u00a0\u00a0 9\u00a0 29\u00a0 34\u00a0 48\u00a0 50\u00a0\u00a0 3\u00a0 37\u00a0 39\u00a0 43\u00a0\u00a0 7\u00a0 18\u00a0 46\u00a0 41\u00a0 42\u00a0\u00a0 4\u00a0\u00a0 8\u00a0 11<br \/>\n[21]\u00a0 28\u00a0 35\u00a0 40\u00a0 49\u00a0 20\u00a0 12\u00a0 26\u00a0 30\u00a0 31\u00a0 47\u00a0 21\u00a0 10\u00a0 33\u00a0 13\u00a0 38\u00a0 17\u00a0\u00a0 6\u00a0 27\u00a0 24\u00a0 19<br \/>\n[41]\u00a0 16\u00a0 22\u00a0 32\u00a0 44\u00a0 14\u00a0 15\u00a0 36\u00a0 23\u00a0 25\u00a0 45\u00a0 51\u00a0 64\u00a0 77\u00a0 59\u00a0 92\u00a0 57\u00a0 87\u00a0 52\u00a0 67\u00a0 69<br \/>\n[61]\u00a0 79\u00a0 85\u00a0 55\u00a0 86 107\u00a0 74\u00a0 56\u00a0 88\u00a0 66\u00a0 76\u00a0 91\u00a0 75\u00a0 98\u00a0 95\u00a0 97\u00a0 96\u00a0 62\u00a0 54\u00a0 72\u00a0 90<br \/>\n[81]\u00a0 89 100\u00a0 93\u00a0 60\u00a0 63\u00a0 68\u00a0 70\u00a0 83\u00a0 81\u00a0 58\u00a0 94\u00a0 61\u00a0 80\u00a0 82\u00a0 65\u00a0 99\u00a0 53\u00a0 73\u00a0 84 120<br \/>\n[101] 134\u00a0 71 127 139 124 128\u00a0 78 102 143 147 150 111 148 114 122 112 101 110 136 103<br \/>\n[121] 105 121 144 137 141 145 113 140 125 129 133 115 142 116 146 149 104 117 138 109<br \/>\n[141] 130 135 106 123 118 119 108 132 126 131<br \/>\nHeight (summary):<br \/>\nMin. 1st Qu.\u00a0 Median\u00a0\u00a0\u00a0 Mean 3rd Qu.\u00a0\u00a0\u00a0 Max.<br \/>\n0.0000\u00a0 0.0000\u00a0 0.1000\u00a0 0.1864\u00a0 0.2038\u00a0 3.7370<\/p>\n<p>Available components:<br \/>\n[1] &#8220;order&#8221;\u00a0 &#8220;height&#8221; &#8220;ac&#8221;\u00a0\u00a0\u00a0\u00a0 &#8220;merge&#8221;\u00a0 &#8220;diss&#8221;\u00a0\u00a0 &#8220;call&#8221;\u00a0\u00a0 &#8220;method&#8221; &#8220;data&#8221;<br \/>\n<strong>&gt; h$order<\/strong><br \/>\n[1]\u00a0\u00a0 1\u00a0\u00a0 2\u00a0\u00a0 5\u00a0\u00a0 9\u00a0 29\u00a0 34\u00a0 48\u00a0 50\u00a0\u00a0 3\u00a0 37\u00a0 39\u00a0 43\u00a0\u00a0 7\u00a0 18\u00a0 46\u00a0 41\u00a0 42\u00a0\u00a0 4\u00a0\u00a0 8\u00a0 11<br \/>\n[21]\u00a0 28\u00a0 35\u00a0 40\u00a0 49\u00a0 20\u00a0 12\u00a0 26\u00a0 30\u00a0 31\u00a0 47\u00a0 21\u00a0 10\u00a0 33\u00a0 13\u00a0 38\u00a0 17\u00a0\u00a0 6\u00a0 27\u00a0 24\u00a0 19<br \/>\n[41]\u00a0 16\u00a0 22\u00a0 32\u00a0 44\u00a0 14\u00a0 15\u00a0 36\u00a0 23\u00a0 25\u00a0 45\u00a0 51\u00a0 64\u00a0 77\u00a0 59\u00a0 92\u00a0 57\u00a0 87\u00a0 52\u00a0 67\u00a0 69<br \/>\n[61]\u00a0 79\u00a0 85\u00a0 55\u00a0 86 107\u00a0 74\u00a0 56\u00a0 88\u00a0 66\u00a0 76\u00a0 91\u00a0 75\u00a0 98\u00a0 95\u00a0 97\u00a0 96\u00a0 62\u00a0 54\u00a0 72\u00a0 90<br \/>\n[81]\u00a0 89 100\u00a0 93\u00a0 60\u00a0 63\u00a0 68\u00a0 70\u00a0 83\u00a0 81\u00a0 58\u00a0 94\u00a0 61\u00a0 80\u00a0 82\u00a0 65\u00a0 99\u00a0 53\u00a0 73\u00a0 84 120<br \/>\n[101] 134\u00a0 71 127 139 124 128\u00a0 78 102 143 147 150 111 148 114 122 112 101 110 136 103<br \/>\n[121] 105 121 144 137 141 145 113 140 125 129 133 115 142 116 146 149 104 117 138 109<br \/>\n[141] 130 135 106 123 118 119 108 132 126 131<br \/>\n<strong>&gt; h$height<\/strong><br \/>\n[1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1000000<br \/>\n[9] 0.0000000 0.0000000 0.0000000 0.1193300 0.0000000 0.0000000 0.1000000 0.0000000<br \/>\n[17] 0.1884517 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1000000<br \/>\n[25] 0.1214732 0.0000000 0.0000000 0.0000000 0.0000000 0.1000000 0.1599476 0.0000000<br \/>\n[33] 0.1000000 0.0000000 0.2577194 0.2986122 0.1000000 0.1207107 0.1471405 0.1868034<br \/>\n[41] 0.0000000 0.0000000 0.2217252 0.3709459 0.1414214 0.0000000 0.1804738 0.4836443<br \/>\n[49] 0.2000000 3.7365080 0.0000000 0.1000000 0.1510749 0.1000000 0.1869891 0.1000000<br \/>\n[57] 0.2335410 0.0000000 0.0000000 0.0000000 0.0000000 0.1000000 0.1554190 0.1000000<br \/>\n[65] 0.3195579 0.3582523 0.1000000 0.1207107 0.0000000 0.1603553 0.2038276 0.0000000<br \/>\n[73] 0.1000000 0.0000000 0.1207107 0.2598380 0.5662487 0.0000000 0.0000000 0.1000000<br \/>\n[81] 0.0000000 0.1165685 0.1825141 0.2663756 0.1000000 0.2352187 0.1000000 0.1207107<br \/>\n[89] 0.9780526 0.0000000 0.2666667 0.0000000 0.2000000 0.3594423 0.4986370 1.5284638<br \/>\n[97] 0.0000000 0.1745356 0.1207107 0.1000000 0.3927946 0.0000000 0.0000000 0.1000000<br \/>\n[105] 0.0000000 0.1907326 0.2947898 0.0000000 0.1000000 0.1138071 0.1589347 0.1000000<br \/>\n[113] 0.1898273 0.1000000 0.2521467 0.8001408 0.1000000 0.2118034 0.4796864 0.2080880<br \/>\n[121] 0.1414214 0.1707107 0.2979830 0.0000000 0.1414214 0.3207243 0.1000000 0.1941714<br \/>\n[129] 0.1207107 0.1000000 0.5593867 0.1000000 0.2135427 0.1000000 0.1500000 0.6629414<br \/>\n[137] 0.1000000 0.0000000 0.3006588 0.2000000 0.3909355 1.1817205 0.1414214 0.1707107<br \/>\n[145] 0.3149057 0.6020066 0.2236068 0.3217620 0.1414214<br \/>\n<strong>&gt; iris[h$order[1:50],5]<\/strong> \/\/\u627e\u51fa1\u523050\u5df2\u7d93\u5206\u7fa4\u7684\u8cc7\u6599<br \/>\n[1] setosa setosa setosa setosa setosa setosa setosa setosa setosa setosa setosa<br \/>\n[12] setosa setosa setosa setosa setosa setosa setosa setosa setosa setosa setosa<br \/>\n[23] setosa setosa setosa setosa setosa setosa setosa setosa setosa setosa setosa<br \/>\n[34] setosa setosa setosa setosa setosa setosa setosa setosa setosa setosa setosa<br \/>\n[45] setosa setosa setosa setosa setosa setosa<br \/>\nLevels: setosa versicolor virginica<\/p>\n<p><strong>&gt; k &lt;- agnes(iris[1:4])<\/strong><br \/>\n<strong>&gt; k<\/strong><br \/>\nCall:\u00a0\u00a0\u00a0 agnes(x = iris[1:4])<br \/>\nAgglomerative coefficient:\u00a0 0.9300174<br \/>\nOrder of objects:<br \/>\n[1]\u00a0\u00a0 1\u00a0 18\u00a0 41\u00a0 28\u00a0 29\u00a0\u00a0 8\u00a0 40\u00a0 50\u00a0\u00a0 5\u00a0 38\u00a0 36\u00a0 24\u00a0 27\u00a0 44\u00a0 21\u00a0 32\u00a0 37\u00a0\u00a0 6\u00a0 19\u00a0 11\u00a0 49\u00a0 20\u00a0 22\u00a0 47\u00a0 17\u00a0 45\u00a0\u00a0 2\u00a0 46\u00a0 13\u00a0 10\u00a0 35\u00a0 26\u00a0\u00a0 3\u00a0\u00a0 4<br \/>\n[35]\u00a0 48\u00a0 30\u00a0 31\u00a0\u00a0 7\u00a0 12\u00a0 25\u00a0\u00a0 9\u00a0 39\u00a0 43\u00a0 14\u00a0 23\u00a0 15\u00a0 16\u00a0 33\u00a0 34\u00a0 42\u00a0 51\u00a0 53\u00a0 87\u00a0 77\u00a0 78\u00a0 55\u00a0 59\u00a0 66\u00a0 76\u00a0 52\u00a0 57\u00a0 86\u00a0 64\u00a0 92\u00a0 79\u00a0 74\u00a0 72\u00a0 75<br \/>\n[69]\u00a0 98\u00a0 69\u00a0 88 120\u00a0 71 128 139 150\u00a0 73\u00a0 84 134 124 127 147 102 143 114 122 115\u00a0 54\u00a0 90\u00a0 70\u00a0 81\u00a0 82\u00a0 60\u00a0 65\u00a0 80\u00a0 56\u00a0 91\u00a0 67\u00a0 85\u00a0 62\u00a0 89\u00a0 96<br \/>\n[103]\u00a0 97\u00a0 95 100\u00a0 68\u00a0 83\u00a0 93\u00a0 63 107\u00a0 58\u00a0 94\u00a0 99\u00a0 61 101 121 144 141 145 125 116 137 149 104 117 138 112 105 129 133 111 148 113 140 142 146<br \/>\n[137] 109 135 103 126 130 108 131 136 106 123 119 110 118 132<br \/>\nHeight (summary):<br \/>\nMin. 1st Qu.\u00a0 Median\u00a0\u00a0\u00a0 Mean 3rd Qu.\u00a0\u00a0\u00a0 Max.<br \/>\n0.0000\u00a0 0.2189\u00a0 0.3317\u00a0 0.4377\u00a0 0.5081\u00a0 4.0630<\/p>\n<p>Available components:<br \/>\n[1] &#8220;order&#8221;\u00a0 &#8220;height&#8221; &#8220;ac&#8221;\u00a0\u00a0\u00a0\u00a0 &#8220;merge&#8221;\u00a0 &#8220;diss&#8221;\u00a0\u00a0 &#8220;call&#8221;\u00a0\u00a0 &#8220;method&#8221; &#8220;data&#8221;<br \/>\n<strong>&gt; table(iris[k$order[101:150],5])<\/strong><\/p>\n<p>setosa versicolor\u00a0 virginica<br \/>\n0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 13\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 37<br \/>\n<strong>&gt; table(iris[k$order[1:50],5])<\/strong><\/p>\n<p>setosa versicolor\u00a0 virginica<br \/>\n50\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<\/p><\/blockquote>\n<p><strong>Measures of Dissimilarity\/Similarity Between Objects<\/strong><\/p>\n<ul>\n<li>Euclidean Distance<\/li>\n<li>Pearson Correlation coefficient<\/li>\n<\/ul>\n<p><strong>Normalization<\/strong><\/p>\n<ul>\n<li>Decimal Scaling<\/li>\n<li>Min-Max normalization<br \/>\nfor normalized interval [0,1]<\/li>\n<li>Standard deviation normalization<\/li>\n<li>\u5728R\u4f5cnormalization\u53ef\u4f7f\u7528scale, \u7bc4\u4f8b\u5982\u4e0b:<\/li>\n<\/ul>\n<blockquote><p>&gt; j &lt;- data.frame(scale(iris[1:4])) \/\/\u5148\u8f49\u63db\u70badata.frame (\u56e0\u70baSCALE\u4e4b\u5f8c\u5c31\u662fmatrix)<br \/>\n&gt; class(j) \/\/\u67e5\u770bj \u7684\u8cc7\u6599\u7d50\u69cb<br \/>\n[1] &#8220;data.frame&#8221;<br \/>\n&gt; plot(j, col=iris[,5]) \/\/\u756b\u5716<\/p><\/blockquote>\n<figure id=\"attachment_266\" aria-describedby=\"caption-attachment-266\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2009\/08\/irisplot_nbormalization.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-266 \" style=\"margin: 10px;\" title=\"irisplot_nbormalization\" src=\"http:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2009\/08\/irisplot_nbormalization-300x299.jpg\" alt=\"\" width=\"300\" height=\"299\" srcset=\"https:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2009\/08\/irisplot_nbormalization-300x299.jpg 300w, https:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2009\/08\/irisplot_nbormalization-150x150.jpg 150w, https:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2009\/08\/irisplot_nbormalization.jpeg 672w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-266\" class=\"wp-caption-text\">\u7d93\u904eNormalization\u7684Iris\u5716<\/figcaption><\/figure>\n<p>TIPS:<\/p>\n<p>1. \u592a\u9ad8\u7dad\u5ea6\u7684OBJECT\u5c31\u4e0d\u518d\u76f8\u50cf<\/p>\n<p>2. \u5206\u7fa4\u5176\u5be6\u6c92\u6709\u6a19\u6e96\u7b54\u6848, \u600e\u9ebc\u5206\u662f\u7531\u81ea\u5df1\u6c7a\u5b9a; \u61c9\u8a72\u662f\u7531\u81ea\u5df1\u5206\u7fa4\u5f8c\u518d\u5411\u5225\u4eba\u89e3\u91cb\u81ea\u5df1\u7684\u65b9\u6cd5\u4ee5\u53ca\u7d50\u679c.<\/p>\n<p>3. \u6771\u897f\u5982\u679c\u50cf, \u600e\u9ebc\u5206\u90fd\u6703\u5728\u4e00\u8d77(\u5982\u4f7f\u7528Single-Link\u8207 Complete Link \u6f14\u7b97\u6cd5).<\/p>\n<p>4. \u9ede\u8ddf\u9ede\u7684\u8ddd\u96e2, \u7fa4\u8ddf\u7fa4\u7684\u8ddd\u96e2\u6c7a\u5b9a\u4e86\u4e0d\u540c\u7684\u7d50\u679c. \u9019\u5c31\u662f\u70ba\u751a\u9ebc\u4e0d\u540c\u7684Algorithm\u6703\u9020\u6210\u4e0d\u540c\u7684\u6a39\u72c0\u5716.<\/p>\n<p>&gt; plot(agnes(iris[1:4], method=&#8221;single&#8221;))<br \/>\n\/\/\u4f7f\u7528single-link\u6f14\u7b97\u6cd5\u756b\u51fa\u7684\u6a39\u72c0\u5716, \u6703\u767c\u73fe\u5206\u5f97\u4e0d\u932f, \u6709\u5169\u5927\u65cf\u7fa4<\/p>\n<p>\/\/UPGMA (Average Link)<\/p>\n<p><a href=\"http:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2009\/08\/single.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-271\" title=\"single\" src=\"http:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2009\/08\/single-300x299.jpg\" alt=\"\" width=\"300\" height=\"299\" srcset=\"https:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2009\/08\/single-300x299.jpg 300w, https:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2009\/08\/single-150x150.jpg 150w, https:\/\/tw.newtonstudio.com\/wp-content\/uploads\/2009\/08\/single.jpeg 672w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Practise:<\/p>\n<p>1. x &lt;- read.delim(filechoose(), row.names = 1, header= TRUE)<\/p>\n<p>2. mean(as.numeric(x[1:27]))<\/p>\n<p>3. a &lt;- function(y) {<\/p>\n<p>(mean(as.numeric(x[y,1:27])) &#8211; mean(as.numeric(x[y,28:38])) ) \/ (sd(as.numeric(x[y,1:27])) &#8211; sd(as.numeric(x[y,28:38])) )<\/p>\n<p>}<\/p>\n<p>4. for(i in 1:7129) {<\/p>\n<p>x[i] = a(i);<\/p>\n<p>}<\/p>\n<p><strong>Partitional<\/strong><\/p>\n<p>K-Means<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8b1b\u5e2b: \u9673\u5029\u745c Feature Selection \u8ab2\u7a0b\u7d44\u7e54 \u5c6c\u6027\u7684\u9078\u64c7 Clustering:\u5206\u7fa4 (Uns [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85],"tags":[],"class_list":["post-251","post","type-post","status-publish","format-standard","hentry","category-r"],"_links":{"self":[{"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/posts\/251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=251"}],"version-history":[{"count":22,"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/posts\/251\/revisions"}],"predecessor-version":[{"id":265,"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/posts\/251\/revisions\/265"}],"wp:attachment":[{"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=251"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/tw.newtonstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}