public class ClustererAssignmentsPlotInstances extends AbstractPlotInstances
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();
| Constructor and Description |
|---|
ClustererAssignmentsPlotInstances() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp()
For freeing up memory.
|
Clusterer |
getClusterer()
Returns the currently set clusterer.
|
ClusterEvaluation |
getClusterEvaluation()
Returns the cluster evaluation object in use.
|
void |
setClusterer(Clusterer value)
Sets the classifier used for making the predictions.
|
void |
setClusterEvaluation(ClusterEvaluation value)
Sets the cluster evaluation object to use.
|
canPlot, getInstances, getOptions, getPlotData, getPlotInstances, listOptions, setInstances, setOptions, setUpequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmakeCopypublic void setClusterer(Clusterer value)
value - the clusterer to usepublic Clusterer getClusterer()
public void setClusterEvaluation(ClusterEvaluation value)
value - the evaluation objectpublic ClusterEvaluation getClusterEvaluation()
public void cleanUp()
cleanUp in class AbstractPlotInstances