How the K-mean Cluster work Step 1. Begin with a decision the value of k = number of clusters Step 2. Put any initial partition that classifies the data into k clusters. You may assign the training samples randomly, or systematically as the following: Take the first k training sample as single-element clusters Assign each of the remaining (N-k) training sample to the cluster with the nearest centroid. After each assignment, recomputed the centroid of the gaining cluster. Step 3 . Take each sample in sequence and compute its distance from the centroid of each of the clusters. If a sample is not currently in the cluster with the closest centroid, switch this sample to that cluster and update the centroid of the cluster gaining the new sample and the cluster losing the sample. Step 4 . Repeat step 3 until convergence is achieved, that is until a pass through the training sample causes no new assignments.
標簽: the decision clusters Cluster
上傳時間: 2013-12-21
上傳用戶:gxmm
一 :排序n個元素,元素為隨機生成的長為1~16的字符串,n的取值為2k(k取4、6、8、10、12、16、18、20),排序算法分別為直接插入排序, 冒泡排序,堆排序,歸并排序,快速排序,比較各種排序在不同輸入下的運行時間. 二:排序n個元素,元素為隨機生成的1~10000的正整數,n的取值為2k(k取4、6、8、10、12、16、18、20),排序算法分別為直接插入排序,快速排序,基數排序,計數排序,比較各種排序在不同輸入下的運行時間.
上傳時間: 2016-02-07
上傳用戶:dsgkjgkjg
約瑟夫環問題算法的優化 1、問題描述: 已知n個人(以編號1,2,3...n分別表示)圍坐在一張圓桌周圍。從編號為k的人開始報數,數到m的那個人出列;他的下一個人又從1開始報數,數到m的那個人又出列;依此規律重復下去,直到圓桌周圍的人全部出列,求最后出列的哪一個人。
標簽: 算法
上傳時間: 2016-02-23
上傳用戶:evil
具體實現以下4條基本編輯命令: (1) 行插入。格式:i《行號》《回車》《文本》。《回車》 將《文本》插入活區中第《行號》行之后。 (2) 行刪除。格式:d《行號1》[《空格》《行號2》]《回車》 刪除活區中第《行號1》行(到第《行號2》行)。例如:“d10”和“和d10 14”。 (3)活區切換。格式:n《回車》 將活區寫如輸出文件。并從輸入文件中讀入下一段,作為新的活區。 (4)活區顯示。格式:p《回車》 各條命令中的行號均須在活區中各行行號范圍之內,只有插入命令的行號可以等于活區第一行行號減一,表示插入當前屏幕中第一行之前,否則命令參數非法
上傳時間: 2013-12-27
上傳用戶:lvzhr
S和T分別是具有m個和n個字符的順序存儲的串,在S和T中尋找最大公共子串。
上傳時間: 2013-12-02
上傳用戶:kelimu
對于n后問題,用n元組工[1:n]表示n后問題的解。其中x[i],表示皇后i放在棋盤的第i行的第i列。由于不允許將2個皇后放在同一列,所以解向量中的x[i]互不相同。2個皇后不能放在同一斜線上是問題的隱約束。對于一般的n后問題,這一隱約束條件可以化成顯約束的形式。將n x n格棋盤看作二維方陣,其行號從上到下,列號從左到右依次編號為1,2,…,n。從棋盤左上角到右下角的主對角線及其平行線(即斜率為一1的各斜線)上,2個下標值的差(行號一列號)值相等。同理,斜率為+1的每一條斜線上,2個下標值的和(行號+列號)值相等。
標簽:
上傳時間: 2016-03-12
上傳用戶:haoxiyizhong
本程序利用奇異值分解對3通道彩色圖像進行壓縮分解,具體步驟如下: 壓縮過程: 1. 選取子圖像大小K值,把圖像分解成M×M個子圖像,IMG(s),s=1,2,…, M2,其中M=N/K,原始圖像IMG大小為N×N。 2. 計算這M2個子圖像的平均值average,對每幅子圖像減去均值圖像得到新圖像。 3. 計算相關矩陣R,其元素定義為 。 4. 計算R的特征值與特征向量,計算每幅子圖像與最大特征向量的內積,便得到編碼,即壓縮后的圖像。
上傳時間: 2013-12-23
上傳用戶:chenxichenyue
漢字液晶子程 液晶屏分為4行*12列漢字,全部使用模擬接口方式。 TGLCMLIMIT64A接口程序(模擬方式) 連線圖: *LCM---89C52* *LCM---89C52* *LCM-------89C52* *LCM----------89C52* * *DB0---P0.0* *DB4---P0.4* *D/I-------P2.6* *CS1----------P2.4* * *DB1---P0.1* *DB5---P0.5* *R/W-------P2.7* *CS2----------P2.5* * *DB2---P0.2* *DB6---P0.6* *RST--------VCC* *CS3----------P3.2* * *DB3---P0.3* *DB7---P0.7* *E---------P2.3* 注:89C52的晶振頻率為12MHz
上傳時間: 2016-03-16
上傳用戶:wab1981
關於USB鼠標,使用PDIUSBD12開發USB鼠標。 內有源碼,C語言開發。
標簽: USB
上傳時間: 2016-03-23
上傳用戶:daoxiang126
Contents at a Glance Introduction 1 PART I INSTALLATION AND CONFIGURATION 5 Hour 1 Preparing to Install Linux 7 2 Installing Linux 23 3 Post-Installation Issues 41 PART II LEARNING LINUX BASICS 67 Hour 4 Reading and Navigation Commands 69 5 Manipulation and Searching Commands 93 6 Using the Shell 117 7 Using the X Window System 143 8 Exploring the K Desktop Environment 177 PART III CONNECTING TO THE OUTSIDE WORLD 197 Hour 9 Using Communications Programs 199 10 Connecting to the Internet 223 11 Configuring Internet Email 249 12 Configuring Internet News 269 13 Internet Downloading and Browsing 289
標簽: CONFIGURATION Introduction INSTALLATION Preparing
上傳時間: 2013-12-27
上傳用戶:qiao8960