类 NBTreeSplit
java.lang.Object
weka.classifiers.trees.j48.ClassifierSplitModel
weka.classifiers.trees.j48.NBTreeSplit
- 所有已实现的接口:
Serializable
,Cloneable
,RevisionHandler
Class implementing a NBTree split on an attribute.
- 版本:
- $Revision: 1.5 $
- 作者:
- Mark Hall (mhall@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明final 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
Return the probability for a class valuedouble
Return the errors made by the naive bayes models arising from this split.Return the global naive bayes model for this nodeReturns the revision string.final String
Prints left side of condition..final String
Prints the condition satisfied by instances in a subset.void
setGlobalModel
(NBTreeNoSplit global) Set the global naive bayes model for this nodefinal String
sourceExpression
(int index, Instances data) Returns a string containing java source code equivalent to the test made at this node.final double[]
Returns weights if instance is assigned to more than one subset.final int
whichSubset
(Instance instance) Returns index of subset instance is assigned to.从类继承的方法 weka.classifiers.trees.j48.ClassifierSplitModel
checkModel, classifyInstance, classProbLaplace, clone, codingCost, distribution, dumpLabel, dumpModel, numSubsets, resetDistribution, sourceClass, split
-
构造器详细资料
-
NBTreeSplit
public NBTreeSplit(int attIndex, int minNoObj, double sumOfWeights) Initializes the split model.
-
-
方法详细资料
-
buildClassifier
Creates a NBTree-type split on the given data. Assumes that none of the class values is missing.- 指定者:
buildClassifier
在类中ClassifierSplitModel
- 抛出:
Exception
- if something goes wrong
-
attIndex
public final int attIndex()Returns index of attribute for which split was generated. -
whichSubset
Returns index of subset instance is assigned to. Returns -1 if instance is assigned to more than one subset.- 指定者:
whichSubset
在类中ClassifierSplitModel
- 抛出:
Exception
- if something goes wrong
-
weights
Returns weights if instance is assigned to more than one subset. Returns null if instance is only assigned to one subset.- 指定者:
weights
在类中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'
-
rightSide
Prints the condition satisfied by instances in a subset.- 指定者:
rightSide
在类中ClassifierSplitModel
- 参数:
index
- of subsetdata
- training set.
-
leftSide
Prints left side of condition..- 指定者:
leftSide
在类中ClassifierSplitModel
- 参数:
data
- training set.
-
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
-
getGlobalModel
Return the global naive bayes model for this node- 返回:
- a
NBTreeNoSplit
value
-
setGlobalModel
Set the global naive bayes model for this node- 参数:
global
- aNBTreeNoSplit
value
-
getErrors
public double getErrors()Return the errors made by the naive bayes models arising from this split.- 返回:
- a
double
value
-
getRevision
Returns the revision string.- 返回:
- the revision
-