|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.trees.UserClassifier
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.
Nested Class Summary | |
private class |
UserClassifier.TreeClass
Inner class used to represent the actual decision tree structure and data. |
Field Summary | |
private static int |
HLINE
|
private static int |
LEAF
I am not sure if these are strictly adhered to in visualizepanel so I am making them private to avoid confusion, (note that they will be correct in this class, VLINE and HLINE aren't used). |
private boolean |
m_built
The status of whether there is a decision tree ready or not. |
private GenericObjectEditor |
m_classifiers
A list of other m_classifiers. |
private UserClassifier.TreeClass |
m_focus
Two references to the structure of the decision tree. |
private VisualizePanel |
m_iView
The instances display. |
private javax.swing.JFrame |
m_mainWin
The window. |
private int |
m_nextId
The next number that can be used as a unique id for a node. |
private PropertyDialog |
m_propertyDialog
A window for selecting other classifiers. |
private javax.swing.JTabbedPane |
m_reps
The tabbed window for the tree and instances view. |
private UserClassifier.TreeClass |
m_top
Two references to the structure of the decision tree. |
private javax.swing.JFrame |
m_treeFrame
These two frames aren't used anymore. |
private TreeVisualizer |
m_tView
The tree display panel. |
private javax.swing.JFrame |
m_visFrame
|
private static int |
POLYGON
|
private static int |
POLYLINE
|
private static int |
RECTANGLE
|
private static int |
VLINE
|
Fields inherited from class weka.classifiers.Classifier |
m_Debug |
Fields inherited from interface weka.core.Drawable |
BayesNet, NOT_DRAWABLE, TREE |
Constructor Summary | |
UserClassifier()
Constructor |
Method Summary | |
private void |
blocker(boolean tf)
A function used to stop the code that called buildclassifier from continuing on before the user has finished the decision tree. |
void |
buildClassifier(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. |
java.lang.String |
globalInfo()
This will return a string describing the classifier. |
java.lang.String |
graph()
Returns a string that describes a graph representing the object. |
int |
graphType()
Returns the type of graph this classifier represents. |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
java.lang.String |
toString()
|
void |
userCommand(TreeDisplayEvent e)
Receives user choices from the tree view, and then deals with these choices. |
void |
userDataEvent(VisualizePanelEvent e)
This receives shapes from the data view. |
Methods inherited from class weka.classifiers.Classifier |
classifyInstance, debugTipText, forName, getDebug, getOptions, listOptions, makeCopies, setDebug, setOptions |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final int LEAF
private static final int RECTANGLE
private static final int POLYGON
private static final int POLYLINE
private static final int VLINE
private static final int HLINE
private TreeVisualizer m_tView
private VisualizePanel m_iView
private UserClassifier.TreeClass m_top
private UserClassifier.TreeClass m_focus
private int m_nextId
private javax.swing.JFrame m_treeFrame
private javax.swing.JFrame m_visFrame
private javax.swing.JTabbedPane m_reps
private javax.swing.JFrame m_mainWin
private boolean m_built
private GenericObjectEditor m_classifiers
private PropertyDialog m_propertyDialog
Constructor Detail |
public UserClassifier()
Method Detail |
public static void main(java.lang.String[] argv)
argv
- should contain command line options (see setOptions)public java.lang.String toString()
public void userCommand(TreeDisplayEvent e)
userCommand
in interface TreeDisplayListener
e
- The choice.public void userDataEvent(VisualizePanelEvent e)
userDataEvent
in interface VisualizePanelListener
e
- Contains the shapes, and other info.public int graphType()
graphType
in interface Drawable
public java.lang.String graph() throws java.lang.Exception
Drawable
graph
in interface Drawable
java.lang.Exception
- if String can't be built properly.private void blocker(boolean tf)
tf
- True to stop the thread, False to release the thread that is
waiting there (if one).public java.lang.String globalInfo()
public void buildClassifier(Instances i) throws java.lang.Exception
buildClassifier
in class Classifier
i
- The training data.
java.lang.Exception
- if can't build classification properly.public double[] distributionForInstance(Instance i) throws java.lang.Exception
distributionForInstance
in class Classifier
i
- The instance to classify.
java.lang.Exception
- if can't classify instance.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |