|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.gui.explorer.AbstractPlotInstances
weka.gui.explorer.ClassifierErrorsPlotInstances
public class ClassifierErrorsPlotInstances
A class for generating plottable visualization errors.
Example usage:Instances train = ... // from somewhere Instances test = ... // from somewhere Classifier cls = ... // from somewhere // build classifier cls.buildClassifier(train); // evaluate classifier and generate plot instances ClassifierPlotInstances plotInstances = new ClassifierPlotInstances(); plotInstances.setClassifier(cls); plotInstances.setInstances(train); plotInstances.setClassIndex(train.classIndex()); plotInstances.setUp(); Evaluation eval = new Evaluation(train); for (int i = 0; i < test.numInstances(); i++) plotInstances.process(test.instance(i), cls, eval); // generate visualization VisualizePanel visPanel = new VisualizePanel(); visPanel.addPlot(plotInstances.getPlotData("plot name")); visPanel.setColourIndex(plotInstances.getPlotInstances().classIndex()+1); // clean up plotInstances.cleanUp();
Constructor Summary | |
---|---|
ClassifierErrorsPlotInstances()
|
Method Summary | |
---|---|
void |
cleanUp()
For freeing up memory. |
Classifier |
getClassifier()
Returns the currently set classifier. |
int |
getClassIndex()
Returns the 0-based class index. |
Evaluation |
getEvaluation()
Returns the Evaluation object in use. |
FastVector |
getPlotShapes()
Get the vector of plot shapes (see weka.gui.visualize.Plot2D). |
FastVector |
getPlotSizes()
Get the vector of plot sizes (see weka.gui.visualize.Plot2D). |
boolean |
getSaveForVisualization()
Returns whether the instances are saved for visualization for only evaluation of the prediction is to happen. |
void |
process(Instance toPredict,
Classifier classifier,
Evaluation eval)
Process a classifier's prediction for an instance and update a set of plotting instances and additional plotting info. |
void |
setClassifier(Classifier value)
Sets the classifier used for making the predictions. |
void |
setClassIndex(int index)
Sets the 0-based class index. |
void |
setEvaluation(Evaluation value)
Sets the Evaluation object to use. |
void |
setSaveForVisualization(boolean value)
Sets whether the instances are saved for visualization or only evaluation of the prediction is to happen. |
Methods inherited from class weka.gui.explorer.AbstractPlotInstances |
---|
getInstances, getOptions, getPlotData, getPlotInstances, listOptions, setInstances, setOptions, setUp |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassifierErrorsPlotInstances()
Method Detail |
---|
public FastVector getPlotShapes()
public FastVector getPlotSizes()
public void setClassifier(Classifier value)
value
- the classifier to usepublic Classifier getClassifier()
public void setClassIndex(int index)
index
- the class indexpublic int getClassIndex()
public void setEvaluation(Evaluation value)
value
- the evaluation to usepublic Evaluation getEvaluation()
public void setSaveForVisualization(boolean value)
value
- if true then the instances will be savedpublic boolean getSaveForVisualization()
public void process(Instance toPredict, Classifier classifier, Evaluation eval)
toPredict
- the actual data pointclassifier
- the classifiereval
- the evaluation object to use for evaluating the classifier on
the instance to predictm_PlotShapes
,
m_PlotSizes
,
AbstractPlotInstances.m_PlotInstances
public void cleanUp()
cleanUp
in class AbstractPlotInstances
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |