|
|||||||||||
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.NBTreeSplit
Class implementing a NBTree split on an attribute.
Constructor Summary | |
NBTreeSplit(int attIndex,
int minNoObj,
double sumOfWeights)
Initializes the split model. |
Method Summary | |
int |
attIndex()
Returns index of attribute for which split was generated. |
void |
buildClassifier(Instances trainInstances)
Creates a NBTree-type split on the given data. |
double |
classProb(int classIndex,
Instance instance,
int theSubset)
Return the probability for a class value |
double |
getErrors()
Return the errors made by the naive bayes models arising from this split. |
NBTreeNoSplit |
getGlobalModel()
Return the global naive bayes model for this node |
java.lang.String |
leftSide(Instances data)
Prints left side of condition.. |
java.lang.String |
rightSide(int index,
Instances data)
Prints the condition satisfied by instances in a subset. |
void |
setGlobalModel(NBTreeNoSplit global)
Set the global naive bayes model for this node |
java.lang.String |
sourceExpression(int index,
Instances data)
Returns a string containing java source code equivalent to the test made at this node. |
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 NBTreeSplit(int attIndex, int minNoObj, double sumOfWeights)
Method Detail |
public void buildClassifier(Instances trainInstances) throws java.lang.Exception
buildClassifier
in class ClassifierSplitModel
java.lang.Exception
- if something goes wrongpublic final int attIndex()
public final int whichSubset(Instance instance) throws java.lang.Exception
whichSubset
in class ClassifierSplitModel
java.lang.Exception
- if something goes wrongpublic final double[] weights(Instance instance)
weights
in class ClassifierSplitModel
public final java.lang.String sourceExpression(int index, Instances data)
sourceExpression
in class ClassifierSplitModel
index
- index of the nominal value testeddata
- the data containing instance structure info
public final java.lang.String rightSide(int index, Instances data)
rightSide
in class ClassifierSplitModel
index
- of subsetdata
- training set.public final java.lang.String leftSide(Instances data)
leftSide
in class ClassifierSplitModel
data
- training set.public double classProb(int classIndex, Instance instance, int theSubset) throws java.lang.Exception
classProb
in class ClassifierSplitModel
classIndex
- the index of the class valueinstance
- the instance to generate a probability fortheSubset
- the subset to consider
java.lang.Exception
- if an error occurspublic NBTreeNoSplit getGlobalModel()
NBTreeNoSplit
valuepublic void setGlobalModel(NBTreeNoSplit global)
global
- a NBTreeNoSplit
valuepublic double getErrors()
double
value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |