All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.classifiers.UserClassifier

java.lang.Object
    |
    +----weka.classifiers.Classifier
            |
            +----weka.classifiers.DistributionClassifier
                    |
                    +----weka.classifiers.UserClassifier

public class UserClassifier
extends DistributionClassifier
implements Drawable, TreeDisplayListener, VisualizePanelListener
Class for generating an user defined decision tree. For more info see

Ware M., Frank E., Holmes G., Hall M. and Witten I.H. (2000). interactive machine learning - letting users build classifiers, Working Paper 00/4, Department of Computer Science, University of Waikato; March. Also available online at http://www.cs.waikato.ac.nz/~ml/publications/2000/ 00MW-etal-Interactive-ML.ps.

Version:
$Revision: 1.8 $
Author:
Malcolm Ware (mfw4@cs.waikato.ac.nz)

Constructor Index

 o UserClassifier()
Constructor

Method Index

 o buildClassifier(Instances)
Call this function to build a decision tree for the training data provided.
 o distributionForInstance(Instance)
Call this function to get a double array filled with the probability of how likely each class type is the class of the instance.
 o globalInfo()
This will return a string describing the classifier.
 o graph()
 
 o main(String[])
Main method for testing this class.
 o toString()
 
 o userCommand(TreeDisplayEvent)
Receives user choices from the tree view, and then deals with these choices.
 o userDataEvent(VisualizePanelEvent)
This receives shapes from the data view.

Constructor Detail

 o UserClassifier
public UserClassifier()
          Constructor

Method Detail

 o main
public static void main(java.lang.String argv[])
          Main method for testing this class.
Parameters:
argv - should contain command line options (see setOptions)
 o toString
public java.lang.String toString()
Returns:
a string that represents this objects tree.
Overrides:
toString in class java.lang.Object
 o userCommand
public void userCommand(TreeDisplayEvent e)
          Receives user choices from the tree view, and then deals with these choices.
Parameters:
e - The choice.
 o userDataEvent
public void userDataEvent(VisualizePanelEvent e)
          This receives shapes from the data view. It then enters these shapes into the decision tree structure.
Parameters:
e - Contains the shapes, and other info.
 o graph
public java.lang.String graph() throws java.lang.Exception
Returns:
A string formatted with a dotty representation of the decision tree.
Throws:
java.lang.Exception - if String can't be built properly.
 o globalInfo
public java.lang.String globalInfo()
          This will return a string describing the classifier.
Returns:
The string.
 o buildClassifier
public void buildClassifier(Instances i) throws java.lang.Exception
          Call this function to build a decision tree for the training data provided.
Parameters:
i - The training data.
Throws:
java.lang.Exception - if can't build classification properly.
Overrides:
buildClassifier in class Classifier
 o 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.
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.
Overrides:
distributionForInstance in class DistributionClassifier

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home