|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.trees.UserClassifier.TreeClass
Inner class used to represent the actual decision tree structure and data.
Field Summary | |
int |
m_attrib1
|
int |
m_attrib2
|
Classifier |
m_classObject
Used instead of the standard leaf if one exists. |
Filter |
m_filter
Used on the instances while classifying if one exists. |
java.lang.String |
m_identity
A string to uniquely identify this node. |
UserClassifier.TreeClass |
m_parent
|
FastVector |
m_ranges
This contains the info for the coords of the shape converted to attrib coords, for polygon the first attrib is the number of points, This is not more object oriented because that would be over kill. |
UserClassifier.TreeClass |
m_set1
|
UserClassifier.TreeClass |
m_set2
|
Instances |
m_training
|
double |
m_weight
|
Constructor Summary | |
UserClassifier.TreeClass(FastVector r,
int a1,
int a2,
int id,
double w,
Instances i,
UserClassifier.TreeClass p)
Constructs a TreeClass node with all the important information. |
Method Summary | |
double[] |
calcClassType(Instance i)
This will recursively go through the tree and return inside the array the weightings of each of the class types for this instance. |
void |
getAlternateLabel(java.lang.StringBuffer s)
Returns a string containing a bit of information about this node, in alternate form. |
void |
getLabel(java.lang.StringBuffer s)
Returns a string containing a bit of information about this node. |
UserClassifier.TreeClass |
getNode(java.lang.String id)
Goes through the tree structure recursively and returns the node that has the id. |
private boolean |
inPoly(FastVector ob,
double x,
double y)
Call this to determine if an instance is in a polygon. |
private boolean |
inPolyline(FastVector ob,
double x,
double y)
Call to find out if an instance is in a polyline. |
void |
objectStrings(java.lang.StringBuffer t)
This will append the class Object in the tree to the string buffer. |
void |
setClassifier(Classifier c)
Call this to set an alternate classifier For this node. |
void |
setInfo(int at1,
int at2,
FastVector ar)
Call this to set this node with different information to what it was created with. |
private void |
setLeaf()
This sets up the informtion about this node such as the s.d or the number of each class. |
private void |
setLinear()
This function gets called to set the node to use a linear regression and attribute filter. |
void |
toDotty(java.lang.StringBuffer t)
Converts The tree structure to a dotty string. |
void |
toString(int l,
java.lang.StringBuffer t)
Converts the tree structure to a string. for people to read. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public FastVector m_ranges
public int m_attrib1
public int m_attrib2
public UserClassifier.TreeClass m_set1
public UserClassifier.TreeClass m_set2
public UserClassifier.TreeClass m_parent
public java.lang.String m_identity
public double m_weight
public Instances m_training
public Classifier m_classObject
public Filter m_filter
Constructor Detail |
public UserClassifier.TreeClass(FastVector r, int a1, int a2, int id, double w, Instances i, UserClassifier.TreeClass p) throws java.lang.Exception
r
- A FastVector containing the shapes, null if it's a leaf node.a1
- The first attribute.a2
- The second attribute.id
- The unique id number for this node.w
- The weight of this node.i
- The instances that make it to this node from the training data.
java.lang.Exception
- if can't use 'i' properly.Method Detail |
public void setClassifier(Classifier c) throws java.lang.Exception
c
- The alternative classifier to use.
java.lang.Exception
- if alternate classifier can't build classification.public void setInfo(int at1, int at2, FastVector ar) throws java.lang.Exception
ar
- The shapes at this node, null if leaf node, or
alternate classifier.
java.lang.Exception
- if leaf node and cant't create leaf info.private void setLeaf() throws java.lang.Exception
java.lang.Exception
- if problem with training instances.public double[] calcClassType(Instance i) throws java.lang.Exception
i
- The instance to test
java.lang.Exception
- if can't use instance i properly.private void setLinear() throws java.lang.Exception
If
- can't set a default linear egression model.
java.lang.Exception
private boolean inPolyline(FastVector ob, double x, double y)
ob
- The polyline to check.x
- The value of attribute1 to check.y
- The value of attribute2 to check.
private boolean inPoly(FastVector ob, double x, double y)
ob
- The polygon.x
- The value of attribute 1.y
- The value of attribute 2.
public UserClassifier.TreeClass getNode(java.lang.String id)
id
- The node to find.
public void getAlternateLabel(java.lang.StringBuffer s) throws java.lang.Exception
s
- The string buffer to fill.
java.lang.Exception
- if can't create label.public void getLabel(java.lang.StringBuffer s) throws java.lang.Exception
s
- The stringbuffer to fill.
java.lang.Exception
- if can't create label.public void toDotty(java.lang.StringBuffer t) throws java.lang.Exception
t
- The stringbuffer to fill with the dotty structure.
java.lang.Exception
- if can't convert structure to dotty.public void objectStrings(java.lang.StringBuffer t)
t
- The stringbuffer.public void toString(int l, java.lang.StringBuffer t) throws java.lang.Exception
l
- How deep this node is in the tree.t
- The stringbuffer to fill with the string.
java.lang.Exception
- if can't convert th string.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |