📄 test_cluster
字号:
test_Clustertest_mean_median:data = [ 34.300, 3.000, 2.000]mean is 13.100; median is 3.000data = [ 5.000, 10.000, 15.000, 20.000]mean is 12.500; median is 12.500data = [ 1.000, 2.000, 3.000, 5.000, 7.000, 11.000, 13.000, 17.000]mean is 7.375; median is 6.000data = [ 100.000, 19.000, 3.000, 1.500, 1.400, 1.000, 1.000, 1.000]mean is 15.988; median is 1.450test_matrix_parse:Read data1 (correct)Read data2 (correct)Refused incorrect matrix data3Refused incorrect matrix data4Refused incorrect matrix data5Refused incorrect matrix data6Refused incorrect matrix data7Refused incorrect matrix data8Refused incorrect matrix data9Refused incorrect matrix data10test_kclusterFirst data setNumber of cluster ids is 4 (should be 4)Correct clustering solution found.Second data setNumber of cluster ids is 13 (should be 13)Correct clustering solution found.test_clusterdistance:First data set:[ 1.100 2.200 3.300 4.400 5.500 ][ 3.100 3.200 1.300 2.400 1.500 ][ 4.100 2.200 0.300 5.400 0.500 ][ 12.100 2.000 0.000 5.000 0.000 ]Clusters are [0] [1, 2] [3]Distance between cluster [0] and [1, 2] is 6.650.Distance between cluster [0] and [3] is 32.508.Distance between cluster [1, 2] and [3] is 15.118.Second data set:[ 1.100 1.200 ][ 1.400 1.300 ][ 1.100 1.500 ][ 2.000 1.500 ][ 1.700 1.900 ][ 1.700 1.900 ][ 5.700 5.900 ][ 5.700 5.900 ][ 3.100 3.300 ][ 5.400 5.300 ][ 5.100 5.500 ][ 5.000 5.500 ][ 5.100 5.200 ]Clusters are [0, 1, 2, 3] [4, 5, 6, 7] [8]Distance between cluster [0, 1, 2, 3] and [4, 5, 6, 7] is 5.833.Distance between cluster [0, 1, 2, 3] and [8] is 3.298.Distance between cluster [4, 5, 6, 7] and [8] is 0.360.test_treecluster:First data set:[ 1.100 2.200 3.300 4.400 5.500 ][ 3.100 3.200 1.300 2.400 1.500 ][ 4.100 2.200 0.300 5.400 0.500 ][ 12.100 2.000 0.000 5.000 0.000 ]Pairwise average-linkage clusteringNumber of nodes is 3 (should be 3)Number of link distances is 3 (should be 3)Node 0 joins node 2 with node 1; link distance is 2.600Node 1 joins node -1 with node 0; link distance is 7.300Node 2 joins node 3 with node -2; link distance is 21.348Pairwise single-linkage clusteringNumber of nodes is 3 (should be 3)Number of link distances is 3 (should be 3)Node 0 joins node 1 with node 2; link distance is 2.600Node 1 joins node 0 with node -1; link distance is 5.800Node 2 joins node -2 with node 3; link distance is 12.908Pairwise centroid-linkage clusteringNumber of nodes is 3 (should be 3)Number of link distances is 3 (should be 3)Node 0 joins node 1 with node 2; link distance is 2.600Node 1 joins node 0 with node -1; link distance is 6.650Node 2 joins node -2 with node 3; link distance is 19.437Pairwise maximum-linkage clusteringNumber of nodes is 3 (should be 3)Number of link distances is 3 (should be 3)Node 0 joins node 2 with node 1; link distance is 2.600Node 1 joins node -1 with node 0; link distance is 8.800Node 2 joins node 3 with node -2; link distance is 32.508Second data set:Pairwise average-linkage clusteringNumber of nodes is 12 (should be 12)Number of link distances is 12 (should be 12)Node 0 joins node 5 with node 4; link distance is 0.003Node 1 joins node 9 with node 12; link distance is 0.029Node 2 joins node 2 with node 1; link distance is 0.061Node 3 joins node 11 with node -2; link distance is 0.070Node 4 joins node -4 with node 10; link distance is 0.128Node 5 joins node 7 with node -5; link distance is 0.224Node 6 joins node -3 with node 0; link distance is 0.254Node 7 joins node -1 with node 3; link distance is 0.391Node 8 joins node -8 with node -7; link distance is 0.532Node 9 joins node 8 with node -9; link distance is 3.234Node 10 joins node -6 with node 6; link distance is 4.636Node 11 joins node -11 with node -10; link distance is 12.741Pairwise single-linkage clusteringNumber of nodes is 12 (should be 12)Number of link distances is 12 (should be 12)Node 0 joins node 4 with node 5; link distance is 0.003Node 1 joins node 9 with node 12; link distance is 0.029Node 2 joins node 11 with node -2; link distance is 0.033Node 3 joins node 1 with node 2; link distance is 0.061Node 4 joins node 10 with node -3; link distance is 0.077Node 5 joins node 7 with node -5; link distance is 0.092Node 6 joins node 0 with node -4; link distance is 0.242Node 7 joins node -7 with node -1; link distance is 0.246Node 8 joins node 3 with node -8; link distance is 0.287Node 9 joins node -9 with node 8; link distance is 1.936Node 10 joins node -10 with node -6; link distance is 3.432Node 11 joins node 6 with node -11; link distance is 3.535Pairwise centroid-linkage clusteringNumber of nodes is 12 (should be 12)Number of link distances is 12 (should be 12)Node 0 joins node 4 with node 5; link distance is 0.003Node 1 joins node 12 with node 9; link distance is 0.029Node 2 joins node 1 with node 2; link distance is 0.061Node 3 joins node -2 with node 11; link distance is 0.063Node 4 joins node 10 with node -4; link distance is 0.109Node 5 joins node -5 with node 7; link distance is 0.189Node 6 joins node 0 with node -3; link distance is 0.239Node 7 joins node 3 with node -1; link distance is 0.390Node 8 joins node -7 with node -8; link distance is 0.382Node 9 joins node -9 with node 8; link distance is 3.063Node 10 joins node 6 with node -6; link distance is 4.578Node 11 joins node -10 with node -11; link distance is 11.536Pairwise maximum-linkage clusteringNumber of nodes is 12 (should be 12)Number of link distances is 12 (should be 12)Node 0 joins node 5 with node 4; link distance is 0.003Node 1 joins node 9 with node 12; link distance is 0.029Node 2 joins node 2 with node 1; link distance is 0.061Node 3 joins node 11 with node 10; link distance is 0.077Node 4 joins node -2 with node -4; link distance is 0.216Node 5 joins node -3 with node 0; link distance is 0.266Node 6 joins node -5 with node 7; link distance is 0.302Node 7 joins node -1 with node 3; link distance is 0.425Node 8 joins node -8 with node -6; link distance is 0.968Node 9 joins node 8 with node 6; link distance is 3.975Node 10 joins node -10 with node -7; link distance is 5.755Node 11 joins node -11 with node -9; link distance is 22.734test_somcluster:First data set:Number of cluster ids is 4 (should be 4)Grid is 2-dimensional (should be 2-dimensional)Second data set:Number of cluster ids is 13 (should be 13)Grid is 2-dimensional (should be 2-dimensional)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -