Package weka.classifiers.trees
Class UserClassifier
- java.lang.Object
-
- weka.classifiers.Classifier
-
- weka.classifiers.trees.UserClassifier
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,CapabilitiesHandler,Drawable,OptionHandler,RevisionHandler,TechnicalInformationHandler,TreeDisplayListener,VisualizePanelListener
public class UserClassifier extends Classifier implements Drawable, TreeDisplayListener, VisualizePanelListener, TechnicalInformationHandler
Interactively classify through visual means. You are Presented with a scatter graph of the data against two user selectable attributes, as well as a view of the decision tree. You can create binary splits by creating polygons around data plotted on the scatter graph, as well as by allowing another classifier to take over at points in the decision tree should you see fit.
For more information see:
Malcolm Ware, Eibe Frank, Geoffrey Holmes, Mark Hall, Ian H. Witten (2001). Interactive machine learning: letting users build classifiers. Int. J. Hum.-Comput. Stud.. 55(3):281-292. BibTeX:@article{Ware2001, author = {Malcolm Ware and Eibe Frank and Geoffrey Holmes and Mark Hall and Ian H. Witten}, journal = {Int. J. Hum.-Comput. Stud.}, number = {3}, pages = {281-292}, title = {Interactive machine learning: letting users build classifiers}, volume = {55}, year = {2001}, PS = {http://www.cs.waikato.ac.nz/\~ml/publications/2000/00MW-etal-Interactive-ML.ps} }Valid options are:-D If set, classifier is run in debug mode and may output additional info to the console
- Version:
- $Revision: 5535 $
- Author:
- Malcolm Ware (mfw4@cs.waikato.ac.nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface weka.core.Drawable
BayesNet, Newick, NOT_DRAWABLE, TREE
-
-
Constructor Summary
Constructors Constructor Description UserClassifier()Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildClassifier(Instances i)Call this function to build a decision tree for the training data provided.double[]distributionForInstance(Instance i)Call this function to get a double array filled with the probability of how likely each class type is the class of the instance.CapabilitiesgetCapabilities()Returns default capabilities of the classifier.java.lang.StringgetRevision()Returns the revision string.TechnicalInformationgetTechnicalInformation()Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.java.lang.StringglobalInfo()This will return a string describing the classifier.java.lang.Stringgraph()Returns a string that describes a graph representing the object.intgraphType()Returns the type of graph this classifier represents.static voidmain(java.lang.String[] argv)Main method for testing this class.java.lang.StringtoString()voiduserCommand(TreeDisplayEvent e)Receives user choices from the tree view, and then deals with these choices.voiduserDataEvent(VisualizePanelEvent e)This receives shapes from the data view.-
Methods inherited from class weka.classifiers.Classifier
classifyInstance, debugTipText, forName, getDebug, getOptions, listOptions, makeCopies, makeCopy, setDebug, setOptions
-
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] argv)
Main method for testing this class.- Parameters:
argv- should contain command line options (see setOptions)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a string that represents this objects tree.
-
userCommand
public void userCommand(TreeDisplayEvent e)
Receives user choices from the tree view, and then deals with these choices.- Specified by:
userCommandin interfaceTreeDisplayListener- Parameters:
e- The choice.
-
userDataEvent
public void userDataEvent(VisualizePanelEvent e)
This receives shapes from the data view. It then enters these shapes into the decision tree structure.- Specified by:
userDataEventin interfaceVisualizePanelListener- Parameters:
e- Contains the shapes, and other info.
-
graphType
public int graphType()
Returns the type of graph this classifier represents.
-
graph
public java.lang.String graph() throws java.lang.ExceptionDescription copied from interface:DrawableReturns a string that describes a graph representing the object. The string should be in XMLBIF ver. 0.3 format if the graph is a BayesNet, otherwise it should be in dotty format.
-
globalInfo
public java.lang.String globalInfo()
This will return a string describing the classifier.- Returns:
- The string.
-
getTechnicalInformation
public TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
getCapabilities
public Capabilities getCapabilities()
Returns default capabilities of the classifier.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Overrides:
getCapabilitiesin classClassifier- Returns:
- the capabilities of this classifier
- See Also:
Capabilities
-
buildClassifier
public void buildClassifier(Instances i) throws java.lang.Exception
Call this function to build a decision tree for the training data provided.- Specified by:
buildClassifierin classClassifier- Parameters:
i- The training data.- Throws:
java.lang.Exception- if can't build classification properly.
-
distributionForInstance
public double[] distributionForInstance(Instance i) throws java.lang.Exception
Call this function to get a double array filled with the probability of how likely each class type is the class of the instance.- Overrides:
distributionForInstancein classClassifier- Parameters:
i- The instance to classify.- Returns:
- A double array filled with the probalities of each class type.
- Throws:
java.lang.Exception- if can't classify instance.
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classClassifier- Returns:
- the revision
-
-