public int[] kmeans(double[] data, double dataMin, double dataMax, int max_itr) {//kϖ@Bef[^_ŏɑNX^̃CfbNXlƂĎzԂB
		int size = data.length;
		int[] cluster = new int[size];
		
		//NX^S
		double[] centers = new double[clusterMax];
		for (int k=0; k<clusterMax; k++) {
			centers[k] = dataMin + (dataMax - dataMin)*Math.random();
		}
		
		//Ce[^
		for (int itr=0; itr<max_itr; itr++) {
			//łS̋߂NX^Ƀf[^z
			for(int i=0; i<size; i++) {
				double minval = Double.MAX_VALUE;
				int index = 0;
				for(int k=0; k<clusterMax; k++){
					double dist = Math.abs(data[i] - centers[k]);
					if(dist < minval) {
						minval = dist;
						index = k;
					}
					cluster[i] = index;
				}
			}
			
			//SČvZ
			int[] dataNum = new int[clusterMax];
			for(int k=0; k<clusterMax; k++){
				centers[k] = 0.0;
			}
			for(int i=0; i<size; i++) {
				int index = cluster[i];
				centers[index] += data[i];
				dataNum[index]++;
			}
			for(int k=0; k<clusterMax; k++) {
				if(dataNum[k]==0) continue;
				centers[k] /= dataNum[k];
			}
		}
		return cluster;
	}