List of usage examples for weka.clusterers SimpleKMeans toString
@Override
public String toString()
From source file:controller.KMeansBean.java
public void calculate() { SimpleKMeans skm = new SimpleKMeans(); try {/*from w ww.j a v a 2 s. com*/ skm.setNumClusters(clusternum); skm.buildClusterer(inst); output = skm.toString(); } catch (Exception ex) { Logger.getLogger(KMeansBean.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:controller.MineroControler.java
public String clasificarSimpleKmeans(int numClusters) { BufferedReader breader = null; Instances datos = null;//from w w w . jav a 2s. c o m breader = new BufferedReader(fuente_arff); try { datos = new Instances(breader); } catch (IOException ex) { System.err.println("Problemas al intentar cargar los datos"); } SimpleKMeans skmeans = new SimpleKMeans(); try { skmeans.setSeed(10); skmeans.setPreserveInstancesOrder(true); skmeans.setNumClusters(numClusters); skmeans.buildClusterer(datos); } catch (Exception ex) { System.err.println("Problemas al ejecutar algorimo de clasificacion"); } return skmeans.toString(); }