|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.trees.j48.ClassifierSplitModel
weka.classifiers.trees.j48.GraftSplit
public class GraftSplit
Class implementing a split for nodes added to a tree during grafting.
| Constructor Summary | |
|---|---|
GraftSplit(int a,
double v,
int t,
double c,
double l)
constructor |
|
GraftSplit(int a,
double v,
int t,
double oC,
double[][] counts)
constructor |
|
| Method Summary | |
|---|---|
int |
attribute()
|
void |
buildClassifier(Instances data)
builds m_graftdistro using the passed data |
double |
classProb(int classIndex,
Instance instance,
int theSubset)
returns the probability for instance for the specified class |
int |
compareTo(java.lang.Object g)
method needed for sorting a collection of GraftSplits by laplace value |
void |
deleteGraftedCases(Instances data)
deletes the cases in data that belong to leaf pointed to by the test (i.e. |
java.lang.String |
dumpLabelG(int index,
Instances data)
Prints label for subset index of instances (eg class). |
NoSplit |
getLeaf()
|
NoSplit |
getOtherLeaf()
|
java.lang.String |
getRevision()
Returns the revision string. |
double |
laplaceForSubsetOfInterest()
|
java.lang.String |
leftSide(Instances data)
Prints left side of condition satisfied by instances. |
int |
maxClassForSubsetOfInterest()
|
double |
positives(int subset)
|
double |
positivesForSubsetOfInterest()
|
java.lang.String |
rightSide(int index,
Instances data)
Prints condition satisfied by instances in subset index. |
java.lang.String |
sourceExpression(int index,
Instances data)
Returns a string containing java source code equivalent to the test made at this node. |
double |
splitPoint()
|
int |
subsetOfInterest()
|
int |
testType()
returns the test type |
java.lang.String |
toString(Instances data)
method for returning information about this GraftSplit |
double |
totalForSubset(int subset)
|
double |
totalForSubsetOfInterest()
|
double[] |
weights(Instance instance)
Returns weights if instance is assigned to more than one subset. |
int |
whichSubset(Instance instance)
Returns index of subset instance is assigned to. |
| Methods inherited from class weka.classifiers.trees.j48.ClassifierSplitModel |
|---|
checkModel, classifyInstance, classProbLaplace, clone, codingCost, distribution, dumpLabel, dumpModel, numSubsets, resetDistribution, sourceClass, split |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GraftSplit(int a,
double v,
int t,
double c,
double l)
a - the attribute to split onv - the value of a where split occurst - the test type (0 is <=, 1 is >, 2 is =, 3 is !)c - the class to label the leaf node pointed to by test as.l - the laplace value (needed when sorting GraftSplits)
public GraftSplit(int a,
double v,
int t,
double oC,
double[][] counts)
throws java.lang.Exception
a - the attribute to split onv - the value of a where split occurst - the test type (0 is <=, 1 is >, 2 is =, 3 is !=)oC - the class to label the leaf node not pointed to by test as.counts - the distribution for this split
java.lang.Exception| Method Detail |
|---|
public void deleteGraftedCases(Instances data)
data - the instances to delete from
public void buildClassifier(Instances data)
throws java.lang.Exception
buildClassifier in class ClassifierSplitModeldata - the instances to use when creating the distribution
java.lang.Exception - if something goes wrongpublic NoSplit getLeaf()
public NoSplit getOtherLeaf()
public final java.lang.String dumpLabelG(int index,
Instances data)
throws java.lang.Exception
index - the bag to dump label fordata - to get attribute names and such
java.lang.Exception - if something goes wrongpublic int subsetOfInterest()
public double positivesForSubsetOfInterest()
public double positives(int subset)
subset - the subset to get the positives for
public double totalForSubsetOfInterest()
public double totalForSubset(int subset)
subset - the index of the bag to get the total for
public java.lang.String leftSide(Instances data)
leftSide in class ClassifierSplitModeldata - the data.public int attribute()
public final java.lang.String rightSide(int index,
Instances data)
rightSide in class ClassifierSplitModel
public final java.lang.String sourceExpression(int index,
Instances data)
sourceExpression in class ClassifierSplitModelindex - index of the nominal value testeddata - the data containing instance structure info
public double[] weights(Instance instance)
ClassifierSplitModel
weights in class ClassifierSplitModelinstance - the instance to produce the weights for
public int whichSubset(Instance instance)
ClassifierSplitModel
whichSubset in class ClassifierSplitModelinstance - the instance for which to determine the subset
public double splitPoint()
public int maxClassForSubsetOfInterest()
public double laplaceForSubsetOfInterest()
public int testType()
public int compareTo(java.lang.Object g)
compareTo in interface java.lang.Comparableg - the graft split to compare to this one
public final double classProb(int classIndex,
Instance instance,
int theSubset)
throws java.lang.Exception
classProb in class ClassifierSplitModelclassIndex - the index of the classinstance - the instance to get the probability fortheSubset - the subset
java.lang.Exception - if something goes wrongpublic java.lang.String toString(Instances data)
data - instances for determining names of attributes and values
public java.lang.String getRevision()
getRevision in interface RevisionHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||