|
||||||||||
| 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.NBTreeNoSplit
public final class NBTreeNoSplit
Class implementing a "no-split"-split (leaf node) for naive bayes trees.
| Constructor Summary | |
|---|---|
NBTreeNoSplit()
|
|
| Method Summary | |
|---|---|
void |
buildClassifier(Instances instances)
Build the no-split node |
double |
classProb(int classIndex,
Instance instance,
int theSubset)
Return the probability for a class value |
static double |
crossValidate(NaiveBayesUpdateable fullModel,
Instances trainingSet,
java.util.Random r)
Utility method for fast 5-fold cross validation of a naive bayes model |
Discretize |
getDiscretizer()
Return the discretizer used at this node |
double |
getErrors()
Return the errors made by the naive bayes model at this node |
NaiveBayesUpdateable |
getNaiveBayesModel()
Get the naive bayes model at this node |
java.lang.String |
getRevision()
Returns the revision string. |
java.lang.String |
leftSide(Instances instances)
Does nothing because no condition has to be satisfied. |
java.lang.String |
rightSide(int index,
Instances instances)
Does nothing because no condition has to be satisfied. |
java.lang.String |
sourceExpression(int index,
Instances data)
Returns a string containing java source code equivalent to the test made at this node. |
java.lang.String |
toString()
Return a textual description of the node |
double[] |
weights(Instance instance)
Always returns null because there is only one subset. |
int |
whichSubset(Instance instance)
Always returns 0 because only there is only one subset. |
| 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, wait, wait, wait |
| Constructor Detail |
|---|
public NBTreeNoSplit()
| Method Detail |
|---|
public final void buildClassifier(Instances instances)
throws java.lang.Exception
buildClassifier in class ClassifierSplitModelinstances - an Instances value
java.lang.Exception - if an error occurspublic double getErrors()
public Discretize getDiscretizer()
Discretize valuepublic NaiveBayesUpdateable getNaiveBayesModel()
NaiveBayesUpdateable valuepublic final int whichSubset(Instance instance)
whichSubset in class ClassifierSplitModelpublic final double[] weights(Instance instance)
weights in class ClassifierSplitModelpublic final java.lang.String leftSide(Instances instances)
leftSide in class ClassifierSplitModelinstances - the data.
public final java.lang.String rightSide(int index,
Instances instances)
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 classProb(int classIndex,
Instance instance,
int theSubset)
throws java.lang.Exception
classProb in class ClassifierSplitModelclassIndex - the index of the class valueinstance - the instance to generate a probability fortheSubset - the subset to consider
java.lang.Exception - if an error occurspublic java.lang.String toString()
toString in class java.lang.ObjectString value
public static double crossValidate(NaiveBayesUpdateable fullModel,
Instances trainingSet,
java.util.Random r)
throws java.lang.Exception
fullModel - a NaiveBayesUpdateable valuetrainingSet - an Instances valuer - a Random value
double value
java.lang.Exception - if an error occurspublic java.lang.String getRevision()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||