Class ClustererAssignmentsPlotInstances

java.lang.Object
weka.gui.explorer.AbstractPlotInstances
weka.gui.explorer.ClustererAssignmentsPlotInstances
All Implemented Interfaces:
Serializable, OptionHandler

public class ClustererAssignmentsPlotInstances extends AbstractPlotInstances
A class for generating plottable cluster assignments.

Example usage:

 Instances train = ... // from somewhere
 Instances test = ... // from somewhere
 Clusterer cls = ... // from somewhere
 // build and evaluate clusterer
 cls.buildClusterer(train);
 ClusterEvaluation eval = new ClusterEvaluation();
 eval.setClusterer(cls);
 eval.evaluateClusterer(test);
 // generate plot instances
 ClustererPlotInstances plotInstances = new ClustererPlotInstances();
 plotInstances.setClusterer(cls);
 plotInstances.setInstances(test);
 plotInstances.setClusterer(cls);
 plotInstances.setClusterEvaluation(eval);
 plotInstances.setUp();
 // generate visualization
 VisualizePanel visPanel = new VisualizePanel();
 visPanel.addPlot(plotInstances.getPlotData("plot name"));
 // clean up
 plotInstances.cleanUp();
 
Version:
$Revision: 10222 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
  • Constructor Details

    • ClustererAssignmentsPlotInstances

      public ClustererAssignmentsPlotInstances()
  • Method Details

    • setClusterer

      public void setClusterer(Clusterer value)
      Sets the classifier used for making the predictions.
      Parameters:
      value - the clusterer to use
    • getClusterer

      public Clusterer getClusterer()
      Returns the currently set clusterer.
      Returns:
      the clusterer in use
    • setClusterEvaluation

      public void setClusterEvaluation(ClusterEvaluation value)
      Sets the cluster evaluation object to use.
      Parameters:
      value - the evaluation object
    • getClusterEvaluation

      public ClusterEvaluation getClusterEvaluation()
      Returns the cluster evaluation object in use.
      Returns:
      the evaluation object
    • cleanUp

      public void cleanUp()
      For freeing up memory. Plot data cannot be generated after this call!
      Overrides:
      cleanUp in class AbstractPlotInstances