聚类-K均值

Posted yuanzhenliu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了聚类-K均值相关的知识,希望对你有一定的参考价值。

数据来源:http://archive.ics.uci.edu/ml/datasets/seeds

15.26    14.84    0.871    5.763    3.312    2.221    5.22    Kama
14.88    14.57    0.8811    5.554    3.333    1.018    4.956    Kama
14.29    14.09    0.905    5.291    3.337    2.699    4.825    Kama
13.84    13.94    0.8955    5.324    3.379    2.259    4.805    Kama
16.14    14.99    0.9034    5.658    3.562    1.355    5.175    Kama
14.38    14.21    0.8951    5.386    3.312    2.462    4.956    Kama
14.69    14.49    0.8799    5.563    3.259    3.586    5.219    Kama
14.11    14.1    0.8911    5.42    3.302    2.7    5.0    Kama
16.63    15.46    0.8747    6.053    3.465    2.04    5.877    Kama
16.44    15.25    0.888    5.884    3.505    1.969    5.533    Kama
15.26    14.85    0.8696    5.714    3.242    4.543    5.314    Kama
14.03    14.16    0.8796    5.438    3.201    1.717    5.001    Kama
13.89    14.02    0.888    5.439    3.199    3.986    4.738    Kama
13.78    14.06    0.8759    5.479    3.156    3.136    4.872    Kama
13.74    14.05    0.8744    5.482    3.114    2.932    4.825    Kama
14.59    14.28    0.8993    5.351    3.333    4.185    4.781    Kama
13.99    13.83    0.9183    5.119    3.383    5.234    4.781    Kama
15.69    14.75    0.9058    5.527    3.514    1.599    5.046    Kama
14.7    14.21    0.9153    5.205    3.466    1.767    4.649    Kama
12.72    13.57    0.8686    5.226    3.049    4.102    4.914    Kama
14.16    14.4    0.8584    5.658    3.129    3.072    5.176    Kama
14.11    14.26    0.8722    5.52    3.168    2.688    5.219    Kama
15.88    14.9    0.8988    5.618    3.507    0.7651    5.091    Kama
12.08    13.23    0.8664    5.099    2.936    1.415    4.961    Kama
15.01    14.76    0.8657    5.789    3.245    1.791    5.001    Kama
16.19    15.16    0.8849    5.833    3.421    0.903    5.307    Kama
13.02    13.76    0.8641    5.395    3.026    3.373    4.825    Kama
12.74    13.67    0.8564    5.395    2.956    2.504    4.869    Kama
14.11    14.18    0.882    5.541    3.221    2.754    5.038    Kama
13.45    14.02    0.8604    5.516    3.065    3.531    5.097    Kama
13.16    13.82    0.8662    5.454    2.975    0.8551    5.056    Kama
15.49    14.94    0.8724    5.757    3.371    3.412    5.228    Kama
14.09    14.41    0.8529    5.717    3.186    3.92    5.299    Kama
13.94    14.17    0.8728    5.585    3.15    2.124    5.012    Kama
15.05    14.68    0.8779    5.712    3.328    2.129    5.36    Kama
16.12    15.0    0.9    5.709    3.485    2.27    5.443    Kama
16.2    15.27    0.8734    5.826    3.464    2.823    5.527    Kama
17.08    15.38    0.9079    5.832    3.683    2.956    5.484    Kama
14.8    14.52    0.8823    5.656    3.288    3.112    5.309    Kama
14.28    14.17    0.8944    5.397    3.298    6.685    5.001    Kama
13.54    13.85    0.8871    5.348    3.156    2.587    5.178    Kama
13.5    13.85    0.8852    5.351    3.158    2.249    5.176    Kama
13.16    13.55    0.9009    5.138    3.201    2.461    4.783    Kama
15.5    14.86    0.882    5.877    3.396    4.711    5.528    Kama
15.11    14.54    0.8986    5.579    3.462    3.128    5.18    Kama
13.8    14.04    0.8794    5.376    3.155    1.56    4.961    Kama
15.36    14.76    0.8861    5.701    3.393    1.367    5.132    Kama
14.99    14.56    0.8883    5.57    3.377    2.958    5.175    Kama
14.79    14.52    0.8819    5.545    3.291    2.704    5.111    Kama
14.86    14.67    0.8676    5.678    3.258    2.129    5.351    Kama
14.43    14.4    0.8751    5.585    3.272    3.975    5.144    Kama
15.78    14.91    0.8923    5.674    3.434    5.593    5.136    Kama
14.49    14.61    0.8538    5.715    3.113    4.116    5.396    Kama
14.33    14.28    0.8831    5.504    3.199    3.328    5.224    Kama
14.52    14.6    0.8557    5.741    3.113    1.481    5.487    Kama
15.03    14.77    0.8658    5.702    3.212    1.933    5.439    Kama
14.46    14.35    0.8818    5.388    3.377    2.802    5.044    Kama
14.92    14.43    0.9006    5.384    3.412    1.142    5.088    Kama
15.38    14.77    0.8857    5.662    3.419    1.999    5.222    Kama
12.11    13.47    0.8392    5.159    3.032    1.502    4.519    Kama
11.42    12.86    0.8683    5.008    2.85    2.7    4.607    Kama
11.23    12.63    0.884    4.902    2.879    2.269    4.703    Kama
12.36    13.19    0.8923    5.076    3.042    3.22    4.605    Kama
13.22    13.84    0.868    5.395    3.07    4.157    5.088    Kama
12.78    13.57    0.8716    5.262    3.026    1.176    4.782    Kama
12.88    13.5    0.8879    5.139    3.119    2.352    4.607    Kama
14.34    14.37    0.8726    5.63    3.19    1.313    5.15    Kama
14.01    14.29    0.8625    5.609    3.158    2.217    5.132    Kama
14.37    14.39    0.8726    5.569    3.153    1.464    5.3    Kama
12.73    13.75    0.8458    5.412    2.882    3.533    5.067    Kama
17.63    15.98    0.8673    6.191    3.561    4.076    6.06    Rosa
16.84    15.67    0.8623    5.998    3.484    4.675    5.877    Rosa
17.26    15.73    0.8763    5.978    3.594    4.539    5.791    Rosa
19.11    16.26    0.9081    6.154    3.93    2.936    6.079    Rosa
16.82    15.51    0.8786    6.017    3.486    4.004    5.841    Rosa
16.77    15.62    0.8638    5.927    3.438    4.92    5.795    Rosa
17.32    15.91    0.8599    6.064    3.403    3.824    5.922    Rosa
20.71    17.23    0.8763    6.579    3.814    4.451    6.451    Rosa
18.94    16.49    0.875    6.445    3.639    5.064    6.362    Rosa
17.12    15.55    0.8892    5.85    3.566    2.858    5.746    Rosa
16.53    15.34    0.8823    5.875    3.467    5.532    5.88    Rosa
18.72    16.19    0.8977    6.006    3.857    5.324    5.879    Rosa
20.2    16.89    0.8894    6.285    3.864    5.173    6.187    Rosa
19.57    16.74    0.8779    6.384    3.772    1.472    6.273    Rosa
19.51    16.71    0.878    6.366    3.801    2.962    6.185    Rosa
18.27    16.09    0.887    6.173    3.651    2.443    6.197    Rosa
18.88    16.26    0.8969    6.084    3.764    1.649    6.109    Rosa
18.98    16.66    0.859    6.549    3.67    3.691    6.498    Rosa
21.18    17.21    0.8989    6.573    4.033    5.78    6.231    Rosa
20.88    17.05    0.9031    6.45    4.032    5.016    6.321    Rosa
20.1    16.99    0.8746    6.581    3.785    1.955    6.449    Rosa
18.76    16.2    0.8984    6.172    3.796    3.12    6.053    Rosa
18.81    16.29    0.8906    6.272    3.693    3.237    6.053    Rosa
18.59    16.05    0.9066    6.037    3.86    6.001    5.877    Rosa
18.36    16.52    0.8452    6.666    3.485    4.933    6.448    Rosa
16.87    15.65    0.8648    6.139    3.463    3.696    5.967    Rosa
19.31    16.59    0.8815    6.341    3.81    3.477    6.238    Rosa
18.98    16.57    0.8687    6.449    3.552    2.144    6.453    Rosa
18.17    16.26    0.8637    6.271    3.512    2.853    6.273    Rosa
18.72    16.34    0.881    6.219    3.684    2.188    6.097    Rosa
16.41    15.25    0.8866    5.718    3.525    4.217    5.618    Rosa
17.99    15.86    0.8992    5.89    3.694    2.068    5.837    Rosa
19.46    16.5    0.8985    6.113    3.892    4.308    6.009    Rosa
19.18    16.63    0.8717    6.369    3.681    3.357    6.229    Rosa
18.95    16.42    0.8829    6.248    3.755    3.368    6.148    Rosa
18.83    16.29    0.8917    6.037    3.786    2.553    5.879    Rosa
18.85    16.17    0.9056    6.152    3.806    2.843    6.2    Rosa
17.63    15.86    0.88    6.033    3.573    3.747    5.929    Rosa
19.94    16.92    0.8752    6.675    3.763    3.252    6.55    Rosa
18.55    16.22    0.8865    6.153    3.674    1.738    5.894    Rosa
18.45    16.12    0.8921    6.107    3.769    2.235    5.794    Rosa
19.38    16.72    0.8716    6.303    3.791    3.678    5.965    Rosa
19.13    16.31    0.9035    6.183    3.902    2.109    5.924    Rosa
19.14    16.61    0.8722    6.259    3.737    6.682    6.053    Rosa
20.97    17.25    0.8859    6.563    3.991    4.677    6.316    Rosa
19.06    16.45    0.8854    6.416    3.719    2.248    6.163    Rosa
18.96    16.2    0.9077    6.051    3.897    4.334    5.75    Rosa
19.15    16.45    0.889    6.245    3.815    3.084    6.185    Rosa
18.89    16.23    0.9008    6.227    3.769    3.639    5.966    Rosa
20.03    16.9    0.8811    6.493    3.857    3.063    6.32    Rosa
20.24    16.91    0.8897    6.315    3.962    5.901    6.188    Rosa
18.14    16.12    0.8772    6.059    3.563    3.619    6.011    Rosa
16.17    15.38    0.8588    5.762    3.387    4.286    5.703    Rosa
18.43    15.97    0.9077    5.98    3.771    2.984    5.905    Rosa
15.99    14.89    0.9064    5.363    3.582    3.336    5.144    Rosa
18.75    16.18    0.8999    6.111    3.869    4.188    5.992    Rosa
18.65    16.41    0.8698    6.285    3.594    4.391    6.102    Rosa
17.98    15.85    0.8993    5.979    3.687    2.257    5.919    Rosa
20.16    17.03    0.8735    6.513    3.773    1.91    6.185    Rosa
17.55    15.66    0.8991    5.791    3.69    5.366    5.661    Rosa
18.3    15.89    0.9108    5.979    3.755    2.837    5.962    Rosa
18.94    16.32    0.8942    6.144    3.825    2.908    5.949    Rosa
15.38    14.9    0.8706    5.884    3.268    4.462    5.795    Rosa
16.16    15.33    0.8644    5.845    3.395    4.266    5.795    Rosa
15.56    14.89    0.8823    5.776    3.408    4.972    5.847    Rosa
15.38    14.66    0.899    5.477    3.465    3.6    5.439    Rosa
17.36    15.76    0.8785    6.145    3.574    3.526    5.971    Rosa
15.57    15.15    0.8527    5.92    3.231    2.64    5.879    Rosa
15.6    15.11    0.858    5.832    3.286    2.725    5.752    Rosa
16.23    15.18    0.885    5.872    3.472    3.769    5.922    Rosa
13.07    13.92    0.848    5.472    2.994    5.304    5.395    Canadian
13.32    13.94    0.8613    5.541    3.073    7.035    5.44    Canadian
13.34    13.95    0.862    5.389    3.074    5.995    5.307    Canadian
12.22    13.32    0.8652    5.224    2.967    5.469    5.221    Canadian
11.82    13.4    0.8274    5.314    2.777    4.471    5.178    Canadian
11.21    13.13    0.8167    5.279    2.687    6.169    5.275    Canadian
11.43    13.13    0.8335    5.176    2.719    2.221    5.132    Canadian
12.49    13.46    0.8658    5.267    2.967    4.421    5.002    Canadian
12.7    13.71    0.8491    5.386    2.911    3.26    5.316    Canadian
10.79    12.93    0.8107    5.317    2.648    5.462    5.194    Canadian
11.83    13.23    0.8496    5.263    2.84    5.195    5.307    Canadian
12.01    13.52    0.8249    5.405    2.776    6.992    5.27    Canadian
12.26    13.6    0.8333    5.408    2.833    4.756    5.36    Canadian
11.18    13.04    0.8266    5.22    2.693    3.332    5.001    Canadian
11.36    13.05    0.8382    5.175    2.755    4.048    5.263    Canadian
11.19    13.05    0.8253    5.25    2.675    5.813    5.219    Canadian
11.34    12.87    0.8596    5.053    2.849    3.347    5.003    Canadian
12.13    13.73    0.8081    5.394    2.745    4.825    5.22    Canadian
11.75    13.52    0.8082    5.444    2.678    4.378    5.31    Canadian
11.49    13.22    0.8263    5.304    2.695    5.388    5.31    Canadian
12.54    13.67    0.8425    5.451    2.879    3.082    5.491    Canadian
12.02    13.33    0.8503    5.35    2.81    4.271    5.308    Canadian
12.05    13.41    0.8416    5.267    2.847    4.988    5.046    Canadian
12.55    13.57    0.8558    5.333    2.968    4.419    5.176    Canadian
11.14    12.79    0.8558    5.011    2.794    6.388    5.049    Canadian
12.1    13.15    0.8793    5.105    2.941    2.201    5.056    Canadian
12.44    13.59    0.8462    5.319    2.897    4.924    5.27    Canadian
12.15    13.45    0.8443    5.417    2.837    3.638    5.338    Canadian
11.35    13.12    0.8291    5.176    2.668    4.337    5.132    Canadian
11.24    13.0    0.8359    5.09    2.715    3.521    5.088    Canadian
11.02    13.0    0.8189    5.325    2.701    6.735    5.163    Canadian
11.55    13.1    0.8455    5.167    2.845    6.715    4.956    Canadian
11.27    12.97    0.8419    5.088    2.763    4.309    5.0    Canadian
11.4    13.08    0.8375    5.136    2.763    5.588    5.089    Canadian
10.83    12.96    0.8099    5.278    2.641    5.182    5.185    Canadian
10.8    12.57    0.859    4.981    2.821    4.773    5.063    Canadian
11.26    13.01    0.8355    5.186    2.71    5.335    5.092    Canadian
10.74    12.73    0.8329    5.145    2.642    4.702    4.963    Canadian
11.48    13.05    0.8473    5.18    2.758    5.876    5.002    Canadian
12.21    13.47    0.8453    5.357    2.893    1.661    5.178    Canadian
11.41    12.95    0.856    5.09    2.775    4.957    4.825    Canadian
12.46    13.41    0.8706    5.236    3.017    4.987    5.147    Canadian
12.19    13.36    0.8579    5.24    2.909    4.857    5.158    Canadian
11.65    13.07    0.8575    5.108    2.85    5.209    5.135    Canadian
12.89    13.77    0.8541    5.495    3.026    6.185    5.316    Canadian
11.56    13.31    0.8198    5.363    2.683    4.062    5.182    Canadian
11.81    13.45    0.8198    5.413    2.716    4.898    5.352    Canadian
10.91    12.8    0.8372    5.088    2.675    4.179    4.956    Canadian
11.23    12.82    0.8594    5.089    2.821    7.524    4.957    Canadian
10.59    12.41    0.8648    4.899    2.787    4.975    4.794    Canadian
10.93    12.8    0.839    5.046    2.717    5.398    5.045    Canadian
11.27    12.86    0.8563    5.091    2.804    3.985    5.001    Canadian
11.87    13.02    0.8795    5.132    2.953    3.597    5.132    Canadian
10.82    12.83    0.8256    5.18    2.63    4.853    5.089    Canadian
12.11    13.27    0.8639    5.236    2.975    4.132    5.012    Canadian
12.8    13.47    0.886    5.16    3.126    4.873    4.914    Canadian
12.79    13.53    0.8786    5.224    3.054    5.483    4.958    Canadian
13.37    13.78    0.8849    5.32    3.128    4.67    5.091    Canadian
12.62    13.67    0.8481    5.41    2.911    3.306    5.231    Canadian
12.76    13.38    0.8964    5.073    3.155    2.828    4.83    Canadian
12.38    13.44    0.8609    5.219    2.989    5.472    5.045    Canadian
12.67    13.32    0.8977    4.984    3.135    2.3    4.745    Canadian
11.18    12.72    0.868    5.009    2.81    4.051    4.828    Canadian
12.7    13.41    0.8874    5.183    3.091    8.456    5.0    Canadian
12.37    13.47    0.8567    5.204    2.96    3.919    5.001    Canadian
12.19    13.2    0.8783    5.137    2.981    3.631    4.87    Canadian
11.23    12.88    0.8511    5.14    2.795    4.325    5.003    Canadian
13.2    13.66    0.8883    5.236    3.232    8.315    5.056    Canadian
11.84    13.21    0.8521    5.175    2.836    3.598    5.044    Canadian
12.3    13.34    0.8684    5.243    2.974    5.637    5.063    Canadian
View Code

聚类方法:K-均值

实现语言:java

输入:样本集seed={X1,X2...Xn}

聚类数目:k =3;

过程:

首先用zscore()函数对数据集进行标准化 Xi = (Xi - μ)/σ (μ 为算数均值, σ 为标准差;

从样本中随机抽取k个数据作为初始均值向量{μ12,...,μk}

repeat:

  令C=Φ (1 ≤ i ≤ k )

  for i=1,2,...,n do

    计算样本 Xi 与各均值向量的距离,并把它加入到离它最近的均值向量所在的集合中;

  end for

  for i =1,2,...,k do

    计算每个集合中所有元素的均值向量 μ′i;

    if  μ′≠ μ

       μi  =  μ′i

    else

      不用更新;

    end if

  end for

until 当前均值向量均未更新

输出:簇分类 C = {C1,C2,...Ck}

程序代码:

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Set;
import java.util.HashSet;

public class KCluster{
	static float[][] seed;
	static String[] kind;
	static int n;
	static float e = (float) 1.0E-20;//0.000000001;-17
	KCluster() throws IOException{
		File file = new File("seeds.txt");
		n = countLines(file);
		seed = new float[n][7];
		kind = new String[n];
		Scanner sc=new Scanner(file);
		for(int i=0;i<n;i++){
			for(int j=0;j<7;j++){
				seed[i][j] = sc.nextFloat();
			}
			kind[i] = sc.next();
		}
		sc.close();
		zscore(seed);//标准化
	}
	public static void main(String[] args) throws FileNotFoundException,IOException{
		new KCluster();
		int k=3;
		float [][] sample =new float[k][];	//存放初始均值向量
		ArrayList<Set<Integer>> set = new ArrayList<Set<Integer>>();
		for(int i=0;i<k;i++){			//从n组数据随机取出k组
			sample[i] = seed[(int)(Math.random()*(n))];
			set.add(new HashSet<Integer>());
		}
		float d;
		int tag;						//簇标记
		Boolean flag;			//标记均值向量是否更新
		do{
			flag =true;
			for(int i=0;i<k;i++){
				set.get(i).clear();
			}
			for(int i=0;i<n;i++){		//按距离最近确定每组数据的簇标记
				d = distance(seed[i],sample[0]);
				tag =0;
				for(int j =1;j<k;j++){
					if(distance(seed[i],sample[j])<d){
						d=distance(seed[i],sample[j]);
						tag=j;	
					}
				}
				set.get(tag).add(i);
			}
			//计算新的均值向量
			for(int i=0;i<k;i++){
				float[] sam = new float[7];				
				for(int j=0;j<7;j++){
					sam[j] = sample[i][j];
					sample[i][j]=0;
				}
				int size = set.get(i).size();
				for(Integer each:set.get(i)){
					float[] temp = seed[each];
					for(int l=0;l<7;l++){
						sample[i][l] +=temp[l];
					}	
				}
				for(int j =0;j<7;j++){
					sample[i][j] /= size;
				}
				for(int j=0;j<7;j++){
					if(sam[j] - sample[i][j] > e){
						flag = false;
						break;
					}
				}
			}
		}while(!flag);
		showset(set);
		show(set);
	}
	public static int countLines(File file)throws IOException{
		byte[] buff = new byte[1024];
		InputStream in =new BufferedInputStream(new FileInputStream(file));
		int count =0;
		int num=0;
		Boolean flag =false;
		while((num=in.read(buff))!=-1){
			flag = true;
			for(int i=0;i<num;i++){
				if(buff[i]==\'\\n\'){
					count++;		
				}
			}
		}
		in.close();
		count = (count==0&&!flag)?0:count+1;
		return count;
	}
	public static float distance(float[] a,float[] b){
		if(a.length!=b.length){
			return -1;
		}
		float s=0 ;
		for(int i=0;i<a.length;i++){
			s += (a[i]-b[i])*(a[i]-b[i]);
		}
		s = (float)Math.sqrt(s);
		return s;
	}
	public static void show(ArrayList<Set<Integer>> set){
		for(int i=0;i<set.size();i++){
			for(Integer each:set.get(i)){
				for(int j=0;j<7;j++){
					System.out.print(seed[each][j]+"\\t");
				}
			System.out.println(kind[each]);
			}
			System.out.println();
		}
	}
	public static void showset(ArrayList<Set<Integer>> set){
		for(int i=0;i<set.size();i++){
			System.out.println("|C"+(i+1)+"| = "+set.get(i).size());
			System.out.print("C"+(i+1)+" = { ");
			for(Integer each:set.get(i)){
				System.out.print(each+",");
			}
			System.out.println(" }");
		}
	}
	public static void zscore(float[][] a){
		float[] x = new float[7];
		float[] s = new float[7];
		for(int i=0;i<n;i++){
			for(int j =0;j<7;j++){
				x[j] += seed[i][j];
			}
		}
		for(int i=0;i<7;i++){
			x[i] /= n;
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<7;j++){
				s[j] += (seed[i][j] - x[j])*(seed[i][j] - x[j]);
			}
		}
		for(int i=0;i<7;i++){
			s[i] = (float)Math.sqrt(s[i]/n);
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<7;j++){
				seed[i][j] = (seed[i][j] - x[j])/s[j];
			}
		}
	}
}

 运行结果:

|C1| = 79
C1 = { 10,140,141,142,143,144,145,146,19,147,148,149,150,151,152,153,26,154,27,155,156,29,157,158,159,32,160,161,162,163,164,166,39,167,168,169,170,171,172,173,174,175,176,177,178,179,52,180,181,182,183,184,185,186,59,187,60,188,189,190,63,191,192,193,194,195,196,69,197,198,200,202,203,204,205,206,207,208,209, }
|C2| = 74
C2 = { 128,129,130,131,132,133,134,8,136,9,137,138,139,36,37,43,51,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,125,126,127, }
|C3| = 57
C3 = { 0,1,2,3,4,5,6,7,11,12,13,14,15,16,17,18,20,21,22,23,24,25,28,30,31,33,34,35,38,40,41,42,44,45,46,47,48,49,50,53,54,55,56,57,58,61,62,64,65,66,67,68,124,135,165,199,201, }
0.14209792    0.22313938    -0.059333883    0.19336289    -0.04406783    0.5618759    -0.19185953    Kama
-0.61235595    -0.49068293    -0.9756335    -0.35413957    -0.7022178    1.0692182    -0.026657853    Canadian
-0.5262311    -0.4753323    -0.41143063    -0.1980341    -0.4925653    2.2232387    0.065121174    Canadian
-0.51934093    -0.4676566    -0.3817359    -0.54191965    -0.48991168    1.529893    -0.20613618    Canadian
-0.9051803    -0.95121354    -0.24598807    -0.91521657    -0.77387106    1.1792201    -0.38153574    Canadian
-1.0429802    -0.88980955    -1.84951    -0.7115997    -1.2780987    0.513875    -0.469236    Canadian
-1.2531247    -1.0970478    -2.3034194    -0.79078466    -1.5169431    1.6458954    -0.2714013    Canadian
-1.1773348    -1.0970478    -1.5907402    -1.0238117    -1.4320204    -0.98615205    -0.5630544    Canadian
-0.73293054    -0.7593259    -0.1017546    -0.9106921    -0.556257    0.26787063    -1.007672    Kama
-0.81216556    -0.8437562    -0.22053362    -0.8179326    -0.77387106    0.48054096    -0.8281936    Canadian
-0.7398207    -0.6518686    -0.92897    -0.5487064    -0.9224855    -0.29347295    -0.18778075    Canadian
-1.0442677    -1.0089532    -0.98572105    -0.89681154    -1.1052654    0.76571053    -0.6584657    Canadian
-1.0395352    -1.0202932    -0.90775836    -0.8269827    -1.1109076    0.9965503    -0.20613618    Canadian
-0.9775251    -0.79770285    -1.9555655    -0.50572056    -1.2807523    2.1945717    -0.28159916    Canadian
-0.8914003    -0.73629886    -1.5992259    -0.49893385    -1.1294843    0.70387834    -0.09804111    Canadian
-1.2634596    -1.1661276    -1.8834475    -0.92426664    -1.50102    -0.24547207    -0.830233    Canadian
-0.6295807    -0.6134909    -0.29265162    -0.52834517    -0.6172951    -0.21813832    -1.1891906    Kama
-1.20145    -1.1584518    -1.3913627    -1.0260739    -1.3364825    0.23186973    -0.29587582    Canadian
-0.7260407    -0.6825706    -0.6192939    -0.52834517    -0.8030629    -0.797482    -1.099451    Kama
-1.2600149    -1.1584518    -1.9385967    -0.85639393    -1.5487893    1.4085578    -0.38561547    Canadian
-1.2083398    -1.2966112    -0.4835461    -1.302088    -1.0870229    -0.23547198    -0.82615423    Canadian
-0.48144615    -0.41392756    -0.44960853    -0.25459445    -0.5137957    -0.1128031    -0.6344377    Kama
-0.93618524    -0.63651794    -2.6682422    -0.5306074    -1.3630214    0.749879    -0.3835761    Canadian
-1.067095    -0.79770285    -2.6639993    -0.41748774    -1.5408278    0.45187363    -0.20001803    Canadian
-1.156665    -1.0279682    -1.8961735    -0.73422426    -1.4957128    1.1252192    -0.20001803    Canadian
-0.26096642    -0.1145833    -0.7677677    0.20014961    -0.19268224    0.14653501    -0.22245318    Kama
-0.79494053    -0.6825706    -1.2089512    -0.4016499    -1.0074081    -0.41214174    0.16913748    Canadian
-0.9740801    -0.9435379    -0.87806356    -0.6301536    -1.1905223    0.3805391    -0.2040968    Canadian
-0.9637452    -0.8821339    -1.2471291    -0.8179326    -1.0923308    0.8585477    -0.738454    Canadian
-0.7914955    -0.7593259    -0.6447484    -0.66861385    -0.7712174    0.4792077    -0.47331476    Canadian
-1.2772396    -1.3580152    -0.6447484    -1.3971087    -1.2329837    1.7918979    -0.7323358    Canadian
-0.82939065    -0.74397457    -1.0519918    -0.7002885    -0.9596389    0.8158802    -0.28159916    Canadian
-0.19551167    -0.29879525    0.9927136    -0.52382064    0.10454658    1.9899013    -0.830233    Kama
-0.9292954    -0.8514319    -1.1325929    -0.47857258    -1.1188691    -0.04146841    -0.14291142    Canadian
-1.2048947    -1.1047236    -1.7773944    -1.0238117    -1.567366    0.4245399    -0.5630544    Canadian
-1.2427899    -1.1968296    -1.48893    -1.2183785    -1.4426361    -0.11946988    -0.65279406    Canadian
-1.3185794    -1.1968296    -2.2100923    -0.68671393    -1.4797896    2.0232353    -0.4998287    Canadian
-1.1359949    -1.1200742    -1.0816866    -1.0441741    -1.0976381    2.0099018    -0.92201203    Canadian
-1.2324547    -1.2198558    -1.2344031    -1.2229041    -1.3152522    0.40587297    -0.8322724    Canadian
-1.18767    -1.1354256    -1.4210573    -1.1143079    -1.3152522    1.2585548    -0.6507537    Canadian
-1.3840345    -1.2275316    -2.591884    -0.7930469    -1.6390193    0.9878835    -0.45495933    Canadian
-1.3943695    -1.5268764    -0.50899804    -1.4649813    -1.1613299    0.7152117    -0.70378155    Canadian
-1.2358997    -1.1891538    -1.5058988    -1.0011883    -1.455905    1.0898852    -0.64463556    Canadian
-1.4150395    -1.4040685    -1.6161947    -1.0939466    -1.6363655    0.66787773    -0.90773535    Canadian
-1.1601101    -1.1584518    -1.0053283    -1.0147628    -1.3285216    1.4505583    -0.8281936    Canadian
-0.9086253    -0.83608055    -1.0901697    -0.6143168    -0.9702547    -1.3594921    -0.469236    Canadian
-0.12316678    0.038926672    -0.7295898    0.19562513    -0.38641226    0.2772041    -0.024618471    Kama
-1.184225    -1.2352072    -0.6362627    -1.2183785    -1.283406    0.83788055    -1.1891906    Canadian
-0.82250047    -0.8821339    -0.016913166    -0.8880675    -0.64117974    0.85788107    -0.5324617    Canadian
-0.9155155    -0.92051154    -0.55566156    -0.87901855    -0.9277934    0.77121276    -0.5100266    Canadian
-1.1015451    -1.1431012    -0.5726304    -1.177656    -1.0843693    1.0058838    -0.5569353    Canadian
-0.67436564    -0.60581523    -0.7168639    -0.30210477    -0.6172951    1.6565621    -0.18778075    Canadian
-1.1325498    -0.95888853    -2.171912    -0.6007423    -1.5275582    0.24120319    -0.46107748    Canadian
-1.046425    -0.8514319    -2.171912    -0.48762155    -1.4399819    0.7985465    -0.11435714    Canadian
-0.9430754    -0.83608055    -1.3489394    -1.062273    -0.601372    -1.465494    -1.8132864    Kama
-1.3564746    -1.3503395    -1.4337833    -1.2229041    -1.5487893    0.31920466    -0.92201203    Canadian
-1.1807798    -1.3042868    -0.11448056    -1.4038965    -1.0843693    -0.66681296    -1.6338081    Kama
-1.2462349    -1.3349888    -0.49203178    -1.2206408    -1.1613299    2.5492449    -0.91997266    Canadian
-1.4667143    -1.6496844    -0.26295686    -1.650498    -1.2515604    0.8498809    -1.2524154    Canadian
-1.3495845    -1.3503395    -1.357425    -1.3179247    -1.4373283    1.1318859    -0.74049336    Canadian
-0.56068087    -0.5520869    -0.12720905    -0.52834517    -0.50052685    0.30453783    -0.65279406    Kama
-1.2324547    -1.3042868    -0.62353677    -1.2161163    -1.2064455    0.189869    -0.830233    Canadian
-1.0257552    -1.1814781    0.36063552    -1.1233579    -0.8110245    -0.06880232    -0.5630544    Canadian
-1.3874797    -1.3273132    -1.9258682    -1.0147628    -1.6682111    0.7685462    -0.6507537    Canadian
-0.9430754    -0.9895905    -0.30113477    -0.8880675    -0.75264066    0.2878708    -0.80779785    Canadian
-0.7053706    -0.83608055    0.636374    -1.0600108    -0.35191247    0.7818798    -1.007672    Canadian
-0.7088157    -0.7900279    0.32245764    -0.91521657    -0.5429882    1.1885536    -0.9179323    Canadian
-0.7294858    -0.6211666    -1.0689607    -0.4898838    -0.99944663    -0.11146968    -0.695624    Kama
-0.5090061    -0.59814024    0.5897104    -0.69802517    -0.34660456    0.646544    -0.64667493    Canadian
-0.7673806    -0.6825706    -0.97139066    -0.49440935    -0.9224855    -0.26280573    -0.36114094    Canadian
-0.8500604    -0.85910755    -0.42839944    -0.9265289    -0.7154866    1.1812203    -0.74049336    Canadian
-1.2634596    -1.4117435    -0.12720905    -1.4016342    -1.1905223    0.23386994    -1.1830715    Canadian
-0.7398207    -0.8821339    0.69576347    -1.007975    -0.44479606    3.1705894    -0.8322724    Canadian
-0.8535055    -0.83608055    -0.606568    -0.96046466    -0.79244775    0.14586821    -0.830233    Canadian
-0.9155155    -1.0433196    0.30973166    -1.1120456    -0.7367176    -0.046135142    -1.0974116    Canadian
-1.2462349    -1.2889355    -0.844126    -1.105259    -1.2303294    0.41653967    -0.82615423    Canadian
-0.567571    -0.6902462    0.7339439    -0.8880675    -0.0706061    3.0765872    -0.71805817    Canadian
-1.03609    -1.0356438    -0.8017053    -1.0260739    -1.1215228    -0.06813553    -0.74253273    Canadian
-0.87762034    -0.9358622    -0.11024026    -0.8722307    -0.7552943    1.2912222    -0.70378155    Canadian

1.8301449    1.8963999    0.10610869    2.0010247    1.365115    -1.1934891    1.5845712    Rosa
0.9310012    0.84485495    1.1920937    0.3675674    1.1448474    1.1105524    0.51585686    Rosa
1.1894805    1.2024993    0.51364076    1.187857    1.0985272    -0.043100893    1.218832    Rosa
1.4098558    1.3514382    0.98423046    1.1661971    1.5031143    -0.5281438    1.1032419    Rosa
0.18343781    0.2615163    -0.016913166    0.577971    0.02493115    0.5078747    0.7891545    Rosa
0.45214725    0.5915633    -0.27992314    0.4897371    0.36196768    0.37720564    0.7891545    Rosa
0.24544781    0.25384137    0.47941706    0.3336316    0.39646748    0.84788096    0.89521027    Rosa
0.6140617    0.691345    0.15701506    0.9603179    0.5477355    -1.106821    0.9563956    Kama
0.8655468    0.9216103    0.3182148    1.1684593    0.8370028    -0.11613641    1.1481122    Rosa
0.54860735    0.5301593    0.72121793    0.577971    0.65388924    -1.1541551    0.2547974    Kama
0.24889255    0.45340395    -0.77625334    0.65941817    -0.07326037    -0.70681363    0.9604753    Rosa
0.25922778    0.42270195    -0.5514213    0.46032578    0.0727004    -0.65014607    0.7014543    Rosa
0.4762621    0.476431    0.59395325    0.55082303    0.56631225    0.04586652    1.0481746    Rosa
0.46592754    0.54551065    0.10186586    0.44675234    0.5450819    -0.58481157    0.24256012    Kama
0.7690867    0.629941    1.5653995    0.46032578    1.1262707    -0.4961432    0.15486082    Kama
0.2247777    0.23081432    0.4666911    0.5621342    0.3646213    0.6738777    0.24459949    Kama
0.32123744    0.26919198    0.9036293    0.10286566    0.4654671    1.2618883    -0.5548959    Kama
0.9585611    1.0904709    -0.1569038    1.27253    0.80250365    0.25053698    1.3296299    Rosa
0.68640697    0.8525306    -0.3690099    0.835886    0.5981584    0.6498774    0.9563956    Rosa
0.8310967    0.89858323    0.2248877    0.7906379    0.89008    0.55920905    0.7809961    Rosa
1.4684207    1.3053856    1.5738852    1.1888205    1.7817664    -0.5094768    1.368381    Rosa
0.6795168    0.7297226    0.32245764    0.8788718    0.60346633    0.20253609    0.88297296    Rosa
0.6622921    0.81415296    -0.30537757    0.67525494    0.47608227    0.81321365    0.7891545    Rosa
0.8517665    1.0367426    -0.47082016    0.98520476    0.38319868    0.08253373    1.0481746    Rosa
2.0196192    2.049909    0.2248877    2.1503434    1.4739218    0.50054145    2.1270869    Rosa
1.4098558    1.4819219    0.16974102    1.8471814    1.0095018    0.9092154    1.9455682    Rosa
0.782867    0.7604246    0.7721218    0.50104934    0.8157724    -0.5614777    0.68921703    Rosa
0.5796123    0.599239    0.47941706    0.55760974    0.5530434    1.221221    0.96251476    Rosa
1.3340656    1.2516572    1.1327043    0.853985    1.588037    1.0825517    0.9604753    Rosa
1.8439251    1.7889419    0.78060746    1.4851958    1.6066138    0.9818832    1.58865    Rosa
1.6268902    1.6738095    0.29276288    1.7091739    1.3624614    -1.4854943    1.7640495    Rosa
1.6062204    1.6507825    0.2970057    1.6684514    1.4394226    -0.49214324    1.5845712    Rosa
1.1790411    1.174902    0.67879725    1.2318064    1.041348    -0.83814937    1.6090457    Rosa
1.3891854    1.3053856    1.0987666    1.0304528    1.3412304    -1.3674921    1.4295675    Rosa
1.4236355    1.6124055    -0.50899804    2.082471    1.0917709    -0.006134461    2.2229447    Rosa
2.1815345    2.0345578    1.183608    2.136769    2.0551105    1.3865573    1.6783897    Rosa
2.0781841    1.9117498    1.3617791    1.8584927    2.0524569    0.8772146    1.8619477    Rosa
1.8094751    1.8656971    0.15277223    2.154868    1.3969612    -1.1634885    2.123007    Rosa
1.3478458    1.259333    1.1623989    1.2295442    1.4261532    -0.38680804    1.3153533    Rosa
1.3650706    1.3284127    0.8315138    1.4557846    1.1528089    -0.30880657    1.3153533    Rosa
1.2892809    1.1441993    1.5102528    0.9241199    1.5959979    1.5338931    0.9563956    Rosa
1.2100462    1.504949    -1.0944126    2.3471725    0.6008121    0.82188046    2.1209679    Rosa
0.6967422    0.83717924    -0.26295686    1.1548847    0.54242826    -0.0028009918    1.1399536    Rosa
1.5373203    1.5586772    0.44547948    1.611891    1.4633065    -0.14880368    1.6926663    Rosa
1.4236355    1.5433259    -0.09751177    1.8562305    0.778619    -1.0374863    2.1311657    Rosa
1.1445911    1.3053856    -0.3096204    1.4535222    0.6724659    -0.5648112    1.7640495    Rosa
1.3340656    1.3667896    0.42426786    1.3358771    1.1289244    -1.0081525    1.4050928    Rosa
0.5382721    0.5301593    0.6618284    0.20241186    0.70696574    0.3445385    0.42815757    Rosa
1.0825812    0.9983649    1.1963365    0.5915455    1.1554626    -1.0881538    0.87481445    Rosa
1.588995    1.4895976    1.1666418    1.0960622    1.6809206    0.40520632    1.2256136    Rosa
1.4925356    1.5893785    0.029750383    1.6752381    1.1209627    -0.22880504    1.6743108    Rosa
1.4133009    1.4281936    0.504869    1.4014875    1.3173465    -0.22147164    1.5091082    Rosa
1.3719606    1.3284127    0.87817734    0.9241199    1.3996149    -0.76481473    0.9604753    Rosa
1.3788508    1.236306    1.4678322    1.184296    1.4526914    -0.571478    1.6151639    Rosa
0.9585611    0.9983649    0.38184714    0.9150698    0.83434916    0.03119954    1.0624512    Rosa
1.7543552    1.8119688    0.17822416    2.3675349    1.3385768    -0.2988063    2.3290005    Rosa
1.2755007    1.2746829    0.6575856    1.1865582    1.1023861    -1.3081578    0.99106807    Rosa
1.2410512    1.197929    0.8951436    1.0824876    1.3544999    -0.9768186    0.78711516    Rosa
1.5614351    1.6584581    0.025507553    1.5259194    1.4128836    -0.014801291    1.1358749    Rosa
1.4753102    1.3437625    1.3787479    1.2544309    1.7074589    -1.0608201    1.0522534    Rosa
1.4787554    1.5740286    0.050962005    1.4263732    1.2695771    1.9879014    1.3153533    Rosa
2.1091893    2.0652604    0.63213366    2.1141455    1.9436496    0.6512107    1.8517498    Rosa
1.4511954    1.4512206    0.61092204    1.781571    1.2218086    -0.9681518    1.5397018    Rosa
1.4167453    1.259333    1.5569165    0.95579344    1.69419    0.42253998    0.69737554    Rosa
1.4822004    1.4512206    0.7636387    1.3946997    1.4765761    -0.41080832    1.5845712    Rosa
1.3926305    1.2823585    1.2642092    1.3539772    1.3544999    -0.040801782    1.1379143    Rosa
1.7853602    1.7966175    0.4285107    1.9557767    1.588037    -0.42480865    1.8599083    Rosa
1.8577048    1.8042932    0.7933334    1.5530684    1.8666885    1.4672253    1.5906904    Rosa
1.1342559    1.197929    0.2630681    0.97389245    0.8078109    -0.05413534    1.2296933    Rosa
0.45559233    0.629941    -0.5174837    0.30195805    0.3407373    0.3905392    0.60151774    Rosa
1.234161    1.082796    1.5569165    0.7951624    1.3598071    -0.47747627    1.0135032    Rosa
1.3444008    1.2439816    1.2260313    1.0915377    1.6198826    0.32520497    1.1909422    Rosa
1.3099507    1.4205179    -0.05085075    1.4851958    0.89008    0.46054047    1.4152907    Rosa
1.079136    0.99068993    1.2005769    0.79290015    1.1368859    -0.96215165    1.0420564    Rosa

0.14209792    0.21546368    5.5627097E-5    0.3042203    0.14170001    -0.98615205    -0.3835761    Kama
0.011188109    0.008224676    0.4285107    -0.16862279    0.19743018    -1.7881664    -0.92201203    Kama
-0.1920666    -0.36019924    1.4423777    -0.7636356    0.20804536    -0.66747975    -1.1891906    Kama
-0.34709126    -0.4753323    1.0393771    -0.68897617    0.31950632    -0.96081823    -1.2299812    Kama
0.4452571    0.33059597    1.374505    0.06666763    0.80515724    -1.5634958    -0.47535414    Kama
-0.16106158    -0.26809326    1.0224084    -0.5487064    0.14170001    -0.82548255    -0.92201203    Kama
-0.054266963    -0.053179312    0.3776043    -0.14826046    0.0010471551    -0.07613573    -0.38561547    Kama
-0.2540766    -0.35252357    0.85272294    -0.47178477    0.115161754    -0.66681296    -0.8322724    Kama
-0.2816365    -0.30647096    0.36487836    -0.43106118    -0.15287516    -1.3221581    -0.830233    Kama
-0.32986623    -0.41392756    0.72121793    -0.42879894    -0.15818307    0.19053578    -1.3666296    Kama
-0.36776137    -0.38322556    0.20791891    -0.3383028    -0.27229765    -0.37614116    -1.0933318    Kama
-0.38154134    -0.39090124    0.1442891    -0.3315161    -0.38375798    -0.5121436    -1.1891906    Kama
-0.08871671    -0.21436496    1.2005769    -0.62789136    0.19743018    0.32320476    -1.2789292    Kama
-0.29541647    -0.5597626    2.0065806    -1.1527692    0.33012152    1.0225508    -1.2789292    Kama
0.29023245    0.14638402    1.4763153    -0.22970763    0.6777732    -1.4008262    -0.738454    Kama
-0.05082189    -0.26809326    1.8793185    -0.9582024    0.55038977    -1.2888242    -1.5481472    Kama
-0.23685156    -0.12225898    -0.5344525    0.06666763    -0.3439509    -0.41880852    -0.47331476    Kama
-0.2540766    -0.2297156    0.050962005    -0.2455444    -0.24045148    -0.67481315    -0.38561547    Kama
0.3556875    0.2615163    1.1793678    -0.023828518    0.6591965    -1.9567695    -0.64667493    Kama
-0.95341027    -1.0202932    -0.1950817    -1.1980174    -0.8561395    -1.5234951    -0.91181415    Kama
0.05597307    0.1540597    -0.22477645    0.3630429    -0.03610692    -1.2728238    -0.830233    Kama
0.46248248    0.46107966    0.5897104    0.4625891    0.4309673    -1.8648345    -0.20613618    Kama
-0.2540766    -0.29111958    0.4666911    -0.1980341    -0.09979863    -0.63081235    -0.75477    Kama
-0.581351    -0.56743824    -0.20356736    -0.39486316    -0.75264066    -1.8967685    -0.71805817    Kama
0.22133262    0.2922183    0.059445135    0.29064578    0.29827598    -0.19213784    -0.3672591    Kama
-0.3126415    -0.29879525    0.07641393    -0.09848789    -0.2882201    -1.0508199    -0.80779785    Kama
0.069753036    0.09265571    0.29276288    0.18883733    0.18416137    -1.0474865    -0.09804111    Kama
0.4383676    0.33827168    1.2302716    0.1820506    0.6008121    -0.95348483    0.07123932    Kama
-0.016371816    -0.030152267    0.47941706    0.06214315    0.07800831    -0.3921414    -0.2020574    Kama
-0.45044115    -0.54441124    0.6830375    -0.63467807    -0.27229765    -0.74214774    -0.469236    Kama
-0.46422112    -0.54441124    0.6024389    -0.62789136    -0.26698977    -0.967485    -0.47331476    Kama
-0.581351    -0.77467656    1.268452    -1.1097834    -0.15287516    -0.8261492    -1.2748505    Kama
0.09042282    -0.014801636    1.1708821    -0.112062424    0.539774    -0.38147452    -0.46515724    Kama
-0.36087123    -0.39857695    0.3563952    -0.57133096    -0.2749513    -1.4268267    -0.91181415    Kama
0.17654766    0.1540597    0.6406168    0.16395159    0.35665977    -1.5554955    -0.5630544    Kama
0.049082924    5.4972694E-4    0.7339439    -0.13242368    0.31419906    -0.49480993    -0.47535414    Kama
-0.2662448    -0.35447562    0.97823554    -0.5559159    0.041497223    -1.4086937    -1.1729264    Kama
0.0042979633    0.084980026    -0.14417532    0.11191571    -0.0016071142    -1.0474865    -0.1163975    Kama
-0.14383656    -0.12225898    0.17398386    -0.09848789    0.035546962    0.18320222    -0.5385799    Kama
-0.17828663    -0.21436496    0.5133521    -0.28174242    -0.15818307    -0.24813876    -0.3754176    Kama
-0.112831555    0.03125172    -0.64898866    0.25444773    -0.38641226    -1.4794943    0.16097897    Kama
0.06286289    0.16173539    -0.22053362    0.16621383    -0.12368326    -1.1781555    0.06308179    Kama
-0.13350166    -0.16063593    0.45820543    -0.54418194    0.31419906    -0.59881175    -0.74253273    Kama
0.024968073    -0.099231936    1.2557261    -0.55323195    0.40708265    -1.7054983    -0.65279406    Kama
0.18343781    0.16173539    0.623648    0.07571768    0.4256594    -1.1341548    -0.37949634    Kama
-1.2462349    -1.4808232    0.55153257    -1.6437113    -1.0074081    -0.95415145    -1.4380128    Kama
-0.8569505    -1.0509952    0.9036293    -1.2500521    -0.57483375    -0.32014006    -1.6378869    Kama
-0.7122608    -0.7593259    0.025507553    -0.8292449    -0.6172951    -1.6828312    -1.2768899    Kama
-0.67781067    -0.8130542    0.7169751    -1.1075212    -0.37048918    -0.8988172    -1.6338081    Kama
-0.17484155    -0.1452853    0.067930795    0.003320544    -0.18206705    -1.5914962    -0.52634263    Kama
-0.28852633    -0.20668928    -0.36052427    -0.044189773    -0.26698977    -0.98881876    -0.5630544    Kama
-0.16450666    -0.12993394    0.067930795    -0.134687    -0.28025857    -1.4908278    -0.22041282    Kama
0.3935823    0.25384137    1.5017698    -0.6007423    0.8582338    -0.24280539    -0.5385799    Rosa
0.18343781    0.07730435    1.1878508    -0.3428273    0.5477355    -0.06680227    0.06308179    Rosa
-0.94652015    -1.0816972    0.35215238    -1.1844428    -0.84287065    -0.9994857    -0.71805817    Canadian
-0.7191506    -0.9051602    1.077555    -1.2568399    -0.2749513    -0.58147806    -1.1789927    Canadian
-0.75015557    -0.95121354    1.1327043    -1.4581934    -0.3280278    -0.9334845    -1.3523529    Canadian
View Code

 

以上是关于聚类-K均值的主要内容,如果未能解决你的问题,请参考以下文章

机器学习实战--k-均值聚类

K-均值聚类

使用 sklearn.cluster 进行 K 均值聚类

使用 sklearn.cluster 进行 K 均值聚类

我应该将行业分类代码视为 K 均值聚类中的双重数据类型吗?

数字数据集上的K-均值聚类