文件名称:kmeans1
- 所属分类:
- 人工智能/神经网络/遗传算法
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2013-08-14
- 文件大小:
- 125kb
- 下载次数:
- 0次
- 提 供 者:
- m***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
K-means算法,算法步骤如下:
Step1.利用式(2)计算距离矩阵D=(),其中=dist[i, j] ();
Step2.扫描坐标距离矩阵D,寻找距离的最大值和最小值,用式(3)计算limit;
Step3.扫描坐标距离矩阵D,寻找矩阵中距离最小的2个数据a,b,将数据a,b加入集合,={a,b},同时将数据a,b从U中删除,更新距离矩阵D;
Step4.利用 (4)式在U中寻找距离集合最近的数据样本t,如果小于limit,则将t加入集合,同时将t从集合U中删除,更新距离矩阵D,重复Step5,否则停止;
Step5.若i<k,i=i+1,重复步骤Step3、Step4,直至k个集合完成;
Step6.取集合中数据的算术平均值记作数据中心,并计算得到的坐标值,完成k个数据中心的选取。-Algorithm steps are as follows:
Step1. Type (2) is used to calculate the distance matrix D = (), including = dist [I, j] ()
Step2. Scan coordinate distance matrix D, looking for the maximum and the minimum distance, use type (3) calculate the limit
Step3. Scan coordinate distance matrix D, looking for matrix minimum distance of two data a, b, and the data to a, b to join the collection, = {a, b}, at the same time the data a, b is removed from the U, update the distance matrix D
Step4. Using (4) in the U find closest to the collection of data samples t, if less than the limit, then t join collection, at the same time t is removed from the set U, update the distance matrix D, repeat Step5, otherwise stop
Step5. If I < k, I = I+ 1, repeat steps Step3, Step4, until k collection is complete
Step6. Take the arithmetic mean of the collection of data for the data center, and to calculate the coordinates, to complete the selection of k data center.
The above steps distribution cu
Step1.利用式(2)计算距离矩阵D=(),其中=dist[i, j] ();
Step2.扫描坐标距离矩阵D,寻找距离的最大值和最小值,用式(3)计算limit;
Step3.扫描坐标距离矩阵D,寻找矩阵中距离最小的2个数据a,b,将数据a,b加入集合,={a,b},同时将数据a,b从U中删除,更新距离矩阵D;
Step4.利用 (4)式在U中寻找距离集合最近的数据样本t,如果小于limit,则将t加入集合,同时将t从集合U中删除,更新距离矩阵D,重复Step5,否则停止;
Step5.若i<k,i=i+1,重复步骤Step3、Step4,直至k个集合完成;
Step6.取集合中数据的算术平均值记作数据中心,并计算得到的坐标值,完成k个数据中心的选取。-Algorithm steps are as follows:
Step1. Type (2) is used to calculate the distance matrix D = (), including = dist [I, j] ()
Step2. Scan coordinate distance matrix D, looking for the maximum and the minimum distance, use type (3) calculate the limit
Step3. Scan coordinate distance matrix D, looking for matrix minimum distance of two data a, b, and the data to a, b to join the collection, = {a, b}, at the same time the data a, b is removed from the U, update the distance matrix D
Step4. Using (4) in the U find closest to the collection of data samples t, if less than the limit, then t join collection, at the same time t is removed from the set U, update the distance matrix D, repeat Step5, otherwise stop
Step5. If I < k, I = I+ 1, repeat steps Step3, Step4, until k collection is complete
Step6. Take the arithmetic mean of the collection of data for the data center, and to calculate the coordinates, to complete the selection of k data center.
The above steps distribution cu
(系统自动生成,下载前可以参看下载内容)
下载文件列表
kmeans1\9类配送结果.txt
.......\9类配送结果.txt.bak
.......\data2.txt
.......\Debug\kmeans.obj
.......\.....\kmeans1.exe
.......\.....\kmeans1.pdb
.......\.....\vc60.pdb
.......\kmeans.cpp
.......\kmeans1.dsp
.......\kmeans1.dsw
.......\kmeans1.ncb
.......\kmeans1.opt
.......\kmeans1.plg
.......\test.txt
.......\Debug
kmeans1