类 GraftSplit
java.lang.Object
weka.classifiers.trees.j48.ClassifierSplitModel
weka.classifiers.trees.j48.GraftSplit
- 所有已实现的接口:
Serializable
,Cloneable
,Comparable
,RevisionHandler
Class implementing a split for nodes added to a tree during grafting.
- 版本:
- $Revision 1.0 $
- 作者:
- Janice Boughton (jrbought@infotech.monash.edu.au)
- 另请参阅:
-
构造器概要
构造器构造器说明GraftSplit
(int a, double v, int t, double c, double l) constructorGraftSplit
(int a, double v, int t, double oC, double[][] counts) constructor -
方法概要
修饰符和类型方法说明int
void
buildClassifier
(Instances data) builds m_graftdistro using the passed datafinal double
returns the probability for instance for the specified classint
method needed for sorting a collection of GraftSplits by laplace valuevoid
deleteGraftedCases
(Instances data) deletes the cases in data that belong to leaf pointed to by the test (i.e.final String
dumpLabelG
(int index, Instances data) Prints label for subset index of instances (eg class).getLeaf()
Returns the revision string.double
Prints left side of condition satisfied by instances.int
double
positives
(int subset) double
final String
Prints condition satisfied by instances in subset index.final String
sourceExpression
(int index, Instances data) Returns a string containing java source code equivalent to the test made at this node.double
int
int
testType()
returns the test typemethod for returning information about this GraftSplitdouble
totalForSubset
(int subset) double
double[]
Returns weights if instance is assigned to more than one subset.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
-
构造器详细资料
-
GraftSplit
public GraftSplit(int a, double v, int t, double c, double l) constructor- 参数:
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)
-
GraftSplit
constructor- 参数:
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- 抛出:
Exception
-
-
方法详细资料
-
deleteGraftedCases
deletes the cases in data that belong to leaf pointed to by the test (i.e. the subset of interest). this is useful so the instances belonging to that leaf aren't passed down the other branch.- 参数:
data
- the instances to delete from
-
buildClassifier
builds m_graftdistro using the passed data- 指定者:
buildClassifier
在类中ClassifierSplitModel
- 参数:
data
- the instances to use when creating the distribution- 抛出:
Exception
- if something goes wrong
-
getLeaf
- 返回:
- the NoSplit object for the leaf pointed to by m_testType branch
-
getOtherLeaf
- 返回:
- the NoSplit object for the leaf not pointed to by m_testType branch
-
dumpLabelG
Prints label for subset index of instances (eg class).- 参数:
index
- the bag to dump label fordata
- to get attribute names and such- 返回:
- the label as a string
- 抛出:
Exception
- if something goes wrong
-
subsetOfInterest
public int subsetOfInterest()- 返回:
- the subset that is specified by the test type
-
positivesForSubsetOfInterest
public double positivesForSubsetOfInterest()- 返回:
- the number of positive cases in the subset of interest
-
positives
public double positives(int subset) - 参数:
subset
- the subset to get the positives for- 返回:
- the number of positive cases in the specified subset
-
totalForSubsetOfInterest
public double totalForSubsetOfInterest()- 返回:
- the number of instances in the subset of interest
-
totalForSubset
public double totalForSubset(int subset) - 参数:
subset
- the index of the bag to get the total for- 返回:
- the number of instances in the subset
-
leftSide
Prints left side of condition satisfied by instances.- 指定者:
leftSide
在类中ClassifierSplitModel
- 参数:
data
- the data.
-
attribute
public int attribute()- 返回:
- the index of the attribute to split on
-
rightSide
Prints condition satisfied by instances in subset index.- 指定者:
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'
-
weights
从类复制的说明:ClassifierSplitModel
Returns weights if instance is assigned to more than one subset. Returns null if instance is only assigned to one subset.- 指定者:
weights
在类中ClassifierSplitModel
- 参数:
instance
- the instance to produce the weights for- 返回:
- a double array of weights, null if only belongs to one subset
-
whichSubset
从类复制的说明:ClassifierSplitModel
Returns index of subset instance is assigned to. Returns -1 if instance is assigned to more than one subset.- 指定者:
whichSubset
在类中ClassifierSplitModel
- 参数:
instance
- the instance for which to determine the subset- 返回:
- an int indicating the subset this instance belongs to
-
splitPoint
public double splitPoint()- 返回:
- the value of the split point
-
maxClassForSubsetOfInterest
public int maxClassForSubsetOfInterest()- 返回:
- the dominate class for the subset of interest
-
laplaceForSubsetOfInterest
public double laplaceForSubsetOfInterest()- 返回:
- the laplace value for maxClass of subset of interest
-
testType
public int testType()returns the test type- 返回:
- value of testtype
-
compareTo
method needed for sorting a collection of GraftSplits by laplace value- 指定者:
compareTo
在接口中Comparable
- 参数:
g
- the graft split to compare to this one- 返回:
- -1, 0, or 1 if this GraftSplit laplace is <, = or > than that of g
-
classProb
returns the probability for instance for the specified class- 覆盖:
classProb
在类中ClassifierSplitModel
- 参数:
classIndex
- the index of the classinstance
- the instance to get the probability fortheSubset
- the subset- 抛出:
Exception
- if something goes wrong
-
toString
method for returning information about this GraftSplit- 参数:
data
- instances for determining names of attributes and values- 返回:
- a string showing this GraftSplit's information
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-