0
助けてください! は、これは私のコードです:文字列属性を処理できません!うーんクラスタリング
SimpleKMeans kmeans = new SimpleKMeans();
kmeans.setSeed(10);
//important parameter to set: preserver order, number of cluster.
kmeans.setPreserveInstancesOrder(true);
kmeans.setNumClusters(5);
BufferedReader datafile = readDataFile("newfile.arff");
Instances data = new Instances(datafile);
System.out.println("weather");
kmeans.buildClusterer(data);
// This array returns the cluster number (starting with 0) for each instance
// The array has as many elements as the number of instances
int[] assignments = kmeans.getAssignments();
int i=0;
for(int clusterNum : assignments) {
System.out.printf("Instance %d -> Cluster %d \n", i, clusterNum);
i++;
そして、これは私の例外です:文字列の属性を処理することはできません:スレッドで
例外 "メイン" weka.core.UnsupportedAttributeTypeException: weka.clusterers.SimpleKMeans!