⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 results.txt

📁 该程序是模式识别课程里的K均值算法程序
💻 TXT
📖 第 1 页 / 共 5 页
字号:
从文件中读取的21个点的坐标数据如下:
Pattern[0]=(3.0,3.0)
Pattern[1]=(5.0,7.0)
Pattern[2]=(0.0,1.0)
Pattern[3]=(1.0,1.0)
Pattern[4]=(4.0,8.0)
Pattern[5]=(1.0,2.0)
Pattern[6]=(6.0,2.0)
Pattern[7]=(9.0,0.0)
Pattern[8]=(3.0,2.0)
Pattern[9]=(6.0,6.0)
Pattern[10]=(2.0,9.0)
Pattern[11]=(3.0,7.0)
Pattern[12]=(4.0,6.0)
Pattern[13]=(5.0,9.0)
Pattern[14]=(6.0,0.0)
Pattern[15]=(3.0,0.0)
Pattern[16]=(4.0,4.0)
Pattern[17]=(4.0,8.0)
Pattern[18]=(2.0,2.0)
Pattern[19]=(1.0,7.0)
Pattern[20]=(9.0,4.0)

假设前2个点为聚类点:
ClusterCenter[0]=(3.0,3.0)
ClusterCenter[1]=(5.0,7.0)


PASS=1

聚类点ClusterCenter[0]与Pattern[0]的距离为:d=( 0.0+ 0.0) = 0.0
聚类点ClusterCenter[1]与Pattern[0]的距离为:d=( 4.0+ 16.0) = 20.0
发现点Patern[0] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[1]的距离为:d=( 4.0+ 16.0) = 20.0
聚类点ClusterCenter[1]与Pattern[1]的距离为:d=( 0.0+ 0.0) = 0.0
发现点Patern[1] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[2]的距离为:d=( 9.0+ 4.0) = 13.0
聚类点ClusterCenter[1]与Pattern[2]的距离为:d=( 25.0+ 36.0) = 61.0
发现点Patern[2] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[3]的距离为:d=( 4.0+ 4.0) = 8.0
聚类点ClusterCenter[1]与Pattern[3]的距离为:d=( 16.0+ 36.0) = 52.0
发现点Patern[3] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[4]的距离为:d=( 1.0+ 25.0) = 26.0
聚类点ClusterCenter[1]与Pattern[4]的距离为:d=( 1.0+ 1.0) = 2.0
发现点Patern[4] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[5]的距离为:d=( 4.0+ 1.0) = 5.0
聚类点ClusterCenter[1]与Pattern[5]的距离为:d=( 16.0+ 25.0) = 41.0
发现点Patern[5] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[6]的距离为:d=( 9.0+ 1.0) = 10.0
聚类点ClusterCenter[1]与Pattern[6]的距离为:d=( 1.0+ 25.0) = 26.0
发现点Patern[6] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[7]的距离为:d=( 36.0+ 9.0) = 45.0
聚类点ClusterCenter[1]与Pattern[7]的距离为:d=( 16.0+ 49.0) = 65.0
发现点Patern[7] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[8]的距离为:d=( 0.0+ 1.0) = 1.0
聚类点ClusterCenter[1]与Pattern[8]的距离为:d=( 4.0+ 25.0) = 29.0
发现点Patern[8] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[9]的距离为:d=( 9.0+ 9.0) = 18.0
聚类点ClusterCenter[1]与Pattern[9]的距离为:d=( 1.0+ 1.0) = 2.0
发现点Patern[9] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[10]的距离为:d=( 1.0+ 36.0) = 37.0
聚类点ClusterCenter[1]与Pattern[10]的距离为:d=( 9.0+ 4.0) = 13.0
发现点Patern[10] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[11]的距离为:d=( 0.0+ 16.0) = 16.0
聚类点ClusterCenter[1]与Pattern[11]的距离为:d=( 4.0+ 0.0) = 4.0
发现点Patern[11] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[12]的距离为:d=( 1.0+ 9.0) = 10.0
聚类点ClusterCenter[1]与Pattern[12]的距离为:d=( 1.0+ 1.0) = 2.0
发现点Patern[12] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[13]的距离为:d=( 4.0+ 36.0) = 40.0
聚类点ClusterCenter[1]与Pattern[13]的距离为:d=( 0.0+ 4.0) = 4.0
发现点Patern[13] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[14]的距离为:d=( 9.0+ 9.0) = 18.0
聚类点ClusterCenter[1]与Pattern[14]的距离为:d=( 1.0+ 49.0) = 50.0
发现点Patern[14] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[15]的距离为:d=( 0.0+ 9.0) = 9.0
聚类点ClusterCenter[1]与Pattern[15]的距离为:d=( 4.0+ 49.0) = 53.0
发现点Patern[15] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[16]的距离为:d=( 1.0+ 1.0) = 2.0
聚类点ClusterCenter[1]与Pattern[16]的距离为:d=( 1.0+ 9.0) = 10.0
发现点Patern[16] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[17]的距离为:d=( 1.0+ 25.0) = 26.0
聚类点ClusterCenter[1]与Pattern[17]的距离为:d=( 1.0+ 1.0) = 2.0
发现点Patern[17] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[18]的距离为:d=( 1.0+ 1.0) = 2.0
聚类点ClusterCenter[1]与Pattern[18]的距离为:d=( 9.0+ 25.0) = 34.0
发现点Patern[18] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[19]的距离为:d=( 4.0+ 16.0) = 20.0
聚类点ClusterCenter[1]与Pattern[19]的距离为:d=( 16.0+ 0.0) = 16.0
发现点Patern[19] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[20]的距离为:d=( 0.0+ 0.0) = 0.0
聚类点ClusterCenter[1]与Pattern[20]的距离为:d=( 4.0+ 16.0) = 20.0
发现点Patern[20] 更接近于聚类点ClusterCenter[0]

新的聚类点计算公式为:
Cluster Center0(1/12)( 3.0+ 0.0+ 1.0+ 1.0+ 6.0+ 9.0+ 3.0+ 6.0+ 3.0+ 4.0+ 2.0+ 3.0),
(1/12)( 3.0+ 1.0+ 1.0+ 2.0+ 2.0+ 0.0+ 2.0+ 0.0+ 0.0+ 4.0+ 2.0+ 3.0)
Cluster Center1(1/9)( 5.0+ 4.0+ 6.0+ 2.0+ 3.0+ 4.0+ 5.0+ 4.0+ 1.0),
(1/9)( 7.0+ 8.0+ 6.0+ 9.0+ 7.0+ 6.0+ 9.0+ 8.0+ 7.0)


在聚类第1个内的点有:
  0    2    3    5    6    7    8    14    15    16    18    20  
在聚类第2个内的点有:
  1    4    9    10    11    12    13    17    19  

求出新的聚类点为:
最合适的第1个点为:ClusterCenter[0]=(3.4,1.7)
最合适的第2个点为:ClusterCenter[1]=(3.8,7.4)


PASS=2

聚类点ClusterCenter[0]与Pattern[0]的距离为:d=( 0.2+ 1.8) = 2.0
聚类点ClusterCenter[1]与Pattern[0]的距离为:d=( 0.6+ 19.8) = 20.4
发现点Patern[0] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[1]的距离为:d=( 2.5+ 28.4) = 31.0
聚类点ClusterCenter[1]与Pattern[1]的距离为:d=( 1.5+ 0.2) = 1.7
发现点Patern[1] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[2]的距离为:d=( 11.7+ 0.4) = 12.1
聚类点ClusterCenter[1]与Pattern[2]的距离为:d=( 14.3+ 41.5) = 55.8
发现点Patern[2] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[3]的距离为:d=( 5.8+ 0.4) = 6.3
聚类点ClusterCenter[1]与Pattern[3]的距离为:d=( 7.7+ 41.5) = 49.2
发现点Patern[3] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[4]的距离为:d=( 0.3+ 40.1) = 40.5
聚类点ClusterCenter[1]与Pattern[4]的距离为:d=( .0+ 0.3) = 0.4
发现点Patern[4] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[5]的距离为:d=( 5.8+ 0.1) = 6.0
聚类点ClusterCenter[1]与Pattern[5]的距离为:d=( 7.7+ 29.6) = 37.4
发现点Patern[5] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[6]的距离为:d=( 6.7+ 0.1) = 6.8
聚类点ClusterCenter[1]与Pattern[6]的距离为:d=( 4.9+ 29.6) = 34.6
发现点Patern[6] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[7]的距离为:d=( 31.2+ 2.8) = 34.0
聚类点ClusterCenter[1]与Pattern[7]的距离为:d=( 27.3+ 55.4) = 82.7
发现点Patern[7] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[8]的距离为:d=( 0.2+ 0.1) = 0.3
聚类点ClusterCenter[1]与Pattern[8]的距离为:d=( 0.6+ 29.6) = 30.2
发现点Patern[8] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[9]的距离为:d=( 6.7+ 18.8) = 25.5
聚类点ClusterCenter[1]与Pattern[9]的距离为:d=( 4.9+ 2.1) = 7.0
发现点Patern[9] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[10]的距离为:d=( 2.0+ 53.8) = 55.8
聚类点ClusterCenter[1]与Pattern[10]的距离为:d=( 3.2+ 2.4) = 5.6
发现点Patern[10] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[11]的距离为:d=( 0.2+ 28.4) = 28.6
聚类点ClusterCenter[1]与Pattern[11]的距离为:d=( 0.6+ 0.2) = 0.8
发现点Patern[11] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[12]的距离为:d=( 0.3+ 18.8) = 19.1
聚类点ClusterCenter[1]与Pattern[12]的距离为:d=( .0+ 2.1) = 2.1
发现点Patern[12] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[13]的距离为:d=( 2.5+ 53.8) = 56.3
聚类点ClusterCenter[1]与Pattern[13]的距离为:d=( 1.5+ 2.4) = 3.9
发现点Patern[13] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[14]的距离为:d=( 6.7+ 2.8) = 9.5
聚类点ClusterCenter[1]与Pattern[14]的距离为:d=( 4.9+ 55.4) = 60.4
发现点Patern[14] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[15]的距离为:d=( 0.2+ 2.8) = 3.0
聚类点ClusterCenter[1]与Pattern[15]的距离为:d=( 0.6+ 55.4) = 56.0
发现点Patern[15] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[16]的距离为:d=( 0.3+ 5.4) = 5.8
聚类点ClusterCenter[1]与Pattern[16]的距离为:d=( .0+ 11.9) = 11.9
发现点Patern[16] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[17]的距离为:d=( 0.3+ 40.1) = 40.5
聚类点ClusterCenter[1]与Pattern[17]的距离为:d=( .0+ 0.3) = 0.4
发现点Patern[17] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[18]的距离为:d=( 2.0+ 0.1) = 2.1
聚类点ClusterCenter[1]与Pattern[18]的距离为:d=( 3.2+ 29.6) = 32.8
发现点Patern[18] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[19]的距离为:d=( 5.8+ 28.4) = 34.3
聚类点ClusterCenter[1]与Pattern[19]的距离为:d=( 7.7+ 0.2) = 7.9
发现点Patern[19] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[20]的距离为:d=( 0.0+ 0.0) = 0.0
聚类点ClusterCenter[1]与Pattern[20]的距离为:d=( 0.1+ 33.4) = 33.5
发现点Patern[20] 更接近于聚类点ClusterCenter[0]

新的聚类点计算公式为:
Cluster Center0(1/12)( 3.0+ 0.0+ 1.0+ 1.0+ 6.0+ 9.0+ 3.0+ 6.0+ 3.0+ 4.0+ 2.0+ 3.4),
(1/12)( 3.0+ 1.0+ 1.0+ 2.0+ 2.0+ 0.0+ 2.0+ 0.0+ 0.0+ 4.0+ 2.0+ 1.7)
Cluster Center1(1/9)( 5.0+ 4.0+ 6.0+ 2.0+ 3.0+ 4.0+ 5.0+ 4.0+ 1.0),
(1/9)( 7.0+ 8.0+ 6.0+ 9.0+ 7.0+ 6.0+ 9.0+ 8.0+ 7.0)


在聚类第1个内的点有:
  0    2    3    5    6    7    8    14    15    16    18    20  
在聚类第2个内的点有:
  1    4    9    10    11    12    13    17    19  

求出新的聚类点为:
最合适的第1个点为:ClusterCenter[0]=(3.5,1.6)
最合适的第2个点为:ClusterCenter[1]=(3.8,7.4)


PASS=3

聚类点ClusterCenter[0]与Pattern[0]的距离为:d=( 0.2+ 2.1) = 2.3
聚类点ClusterCenter[1]与Pattern[0]的距离为:d=( 0.6+ 19.8) = 20.4
发现点Patern[0] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[1]的距离为:d=( 2.4+ 29.6) = 32.0
聚类点ClusterCenter[1]与Pattern[1]的距离为:d=( 1.5+ 0.2) = 1.7
发现点Patern[1] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[2]的距离为:d=( 11.9+ 0.3) = 12.2
聚类点ClusterCenter[1]与Pattern[2]的距离为:d=( 14.3+ 41.5) = 55.8
发现点Patern[2] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[3]的距离为:d=( 6.0+ 0.3) = 6.3
聚类点ClusterCenter[1]与Pattern[3]的距离为:d=( 7.7+ 41.5) = 49.2
发现点Patern[3] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[4]的距离为:d=( 0.3+ 41.5) = 41.8
聚类点ClusterCenter[1]与Pattern[4]的距离为:d=( .0+ 0.3) = 0.4
发现点Patern[4] 更接近于聚类点ClusterCenter[1]

聚类点ClusterCenter[0]与Pattern[5]的距离为:d=( 6.0+ 0.2) = 6.2
聚类点ClusterCenter[1]与Pattern[5]的距离为:d=( 7.7+ 29.6) = 37.4
发现点Patern[5] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[6]的距离为:d=( 6.5+ 0.2) = 6.7
聚类点ClusterCenter[1]与Pattern[6]的距离为:d=( 4.9+ 29.6) = 34.6
发现点Patern[6] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[7]的距离为:d=( 30.8+ 2.4) = 33.2
聚类点ClusterCenter[1]与Pattern[7]的距离为:d=( 27.3+ 55.4) = 82.7
发现点Patern[7] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[8]的距离为:d=( 0.2+ 0.2) = 0.4
聚类点ClusterCenter[1]与Pattern[8]的距离为:d=( 0.6+ 29.6) = 30.2
发现点Patern[8] 更接近于聚类点ClusterCenter[0]

聚类点ClusterCenter[0]与Pattern[9]的距离为:d=( 6.5+ 19.8) = 26.2

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -