Example usage for weka.clusterers ClusterEvaluation clusterResultsToString

List of usage examples for weka.clusterers ClusterEvaluation clusterResultsToString

Introduction

In this page you can find the example usage for weka.clusterers ClusterEvaluation clusterResultsToString.

Prototype

public String clusterResultsToString() 

Source Link

Document

return the results of clustering.

Usage

From source file:wekimini.InputGenerator.java

public void selectEmClusters() throws Exception {
    String[] options = new String[2];
    options[0] = "-I";
    options[1] = "100";

    buildDataset();// w w w. j a v  a  2  s  .c om

    EM clusterer = new EM();
    clusterer.setOptions(options);
    clusterer.buildClusterer(dataset);

    ClusterEvaluation eval = new ClusterEvaluation();
    eval.setClusterer(clusterer);
    eval.evaluateClusterer(dataset);
    System.out.println(eval.clusterResultsToString());

    double[][][] clusterAtts = clusterer.getClusterModelsNumericAtts();
    System.out.println(Arrays.deepToString(clusterAtts));

    numClusters = clusterer.numberOfClusters();
    System.out.println(numClusters);

    addEmClustersToTraining(clusterAtts);
}