类 NBTreeNoSplit
java.lang.Object
weka.classifiers.trees.j48.ClassifierSplitModel
weka.classifiers.trees.j48.NBTreeNoSplit
- 所有已实现的接口:
Serializable
,Cloneable
,RevisionHandler
Class implementing a "no-split"-split (leaf node) for naive bayes
trees.
- 版本:
- $Revision: 1.4 $
- 作者:
- Mark Hall (mhall@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明final void
buildClassifier
(Instances instances) Build the no-split nodedouble
Return the probability for a class valuestatic double
crossValidate
(NaiveBayesUpdateable fullModel, Instances trainingSet, Random r) Utility method for fast 5-fold cross validation of a naive bayes modelReturn the discretizer used at this nodedouble
Return the errors made by the naive bayes model at this nodeGet the naive bayes model at this nodeReturns the revision string.final String
Does nothing because no condition has to be satisfied.final String
Does nothing because no condition has to be satisfied.final String
sourceExpression
(int index, Instances data) Returns a string containing java source code equivalent to the test made at this node.toString()
Return a textual description of the nodefinal double[]
Always returns null because there is only one subset.final int
whichSubset
(Instance instance) Always returns 0 because only there is only one subset.从类继承的方法 weka.classifiers.trees.j48.ClassifierSplitModel
checkModel, classifyInstance, classProbLaplace, clone, codingCost, distribution, dumpLabel, dumpModel, numSubsets, resetDistribution, sourceClass, split
-
构造器详细资料
-
NBTreeNoSplit
public NBTreeNoSplit()
-
-
方法详细资料
-
buildClassifier
Build the no-split node- 指定者:
buildClassifier
在类中ClassifierSplitModel
- 参数:
instances
- anInstances
value- 抛出:
Exception
- if an error occurs
-
getErrors
public double getErrors()Return the errors made by the naive bayes model at this node- 返回:
- the number of errors made
-
getDiscretizer
Return the discretizer used at this node- 返回:
- a
Discretize
value
-
getNaiveBayesModel
Get the naive bayes model at this node- 返回:
- a
NaiveBayesUpdateable
value
-
whichSubset
Always returns 0 because only there is only one subset.- 指定者:
whichSubset
在类中ClassifierSplitModel
-
weights
Always returns null because there is only one subset.- 指定者:
weights
在类中ClassifierSplitModel
-
leftSide
Does nothing because no condition has to be satisfied.- 指定者:
leftSide
在类中ClassifierSplitModel
- 参数:
instances
- the data.
-
rightSide
Does nothing because no condition has to be satisfied.- 指定者:
rightSide
在类中ClassifierSplitModel
-
sourceExpression
Returns a string containing java source code equivalent to the test made at this node. The instance being tested is called "i".- 指定者:
sourceExpression
在类中ClassifierSplitModel
- 参数:
index
- index of the nominal value testeddata
- the data containing instance structure info- 返回:
- a value of type 'String'
-
classProb
Return the probability for a class value- 覆盖:
classProb
在类中ClassifierSplitModel
- 参数:
classIndex
- the index of the class valueinstance
- the instance to generate a probability fortheSubset
- the subset to consider- 返回:
- a probability
- 抛出:
Exception
- if an error occurs
-
toString
Return a textual description of the node -
crossValidate
public static double crossValidate(NaiveBayesUpdateable fullModel, Instances trainingSet, Random r) throws Exception Utility method for fast 5-fold cross validation of a naive bayes model- 参数:
fullModel
- aNaiveBayesUpdateable
valuetrainingSet
- anInstances
valuer
- aRandom
value- 返回:
- a
double
value - 抛出:
Exception
- if an error occurs
-
getRevision
Returns the revision string.- 返回:
- the revision
-