Package weka.classifiers.trees.lmt
Class ResidualSplit
java.lang.Object
weka.classifiers.trees.j48.ClassifierSplitModel
weka.classifiers.trees.lmt.ResidualSplit
- All Implemented Interfaces:
Serializable
,Cloneable
,RevisionHandler
Helper class for logistic model trees (weka.classifiers.trees.lmt.LMT) to implement the
splitting criterion based on residuals of the LogitBoost algorithm.
- Version:
- $Revision: 8034 $
- Author:
- Niels Landwehr
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildClassifier
(Instances data) Method not in usevoid
buildClassifier
(Instances data, double[][] dataZs, double[][] dataWs) Builds the split.boolean
checkModel
(int minNumInstances) Checks if there are at least 2 subsets that contain >= minNumInstances.double
Computes entropy gain for current split.Returns the revision string.final String
Returns name of splitting attribute (left side of condition).final String
Prints the condition satisfied by instances in a subset.final String
sourceExpression
(int index, Instances data) Method not in usefinal double[]
Method not in usefinal int
whichSubset
(Instance instance) Returns index of subset instance is assigned to.Methods inherited from class weka.classifiers.trees.j48.ClassifierSplitModel
checkModel, classifyInstance, classProb, classProbLaplace, clone, codingCost, distribution, dumpLabel, dumpModel, numSubsets, resetDistribution, setDistribution, sourceClass, split
-
Constructor Details
-
ResidualSplit
public ResidualSplit(int attIndex) Creates a split object- Parameters:
attIndex
- the index of the attribute to split on
-
-
Method Details
-
buildClassifier
Builds the split. Needs the Z/W values of LogitBoost for the set of instances.- Throws:
Exception
-
entropyGain
Computes entropy gain for current split.- Throws:
Exception
-
checkModel
public boolean checkModel(int minNumInstances) Checks if there are at least 2 subsets that contain >= minNumInstances. -
leftSide
Returns name of splitting attribute (left side of condition).- Specified by:
leftSide
in classClassifierSplitModel
- Parameters:
data
- the data.
-
rightSide
Prints the condition satisfied by instances in a subset.- Specified by:
rightSide
in classClassifierSplitModel
-
whichSubset
Description copied from class:ClassifierSplitModel
Returns index of subset instance is assigned to. Returns -1 if instance is assigned to more than one subset.- Specified by:
whichSubset
in classClassifierSplitModel
- Throws:
Exception
- if something goes wrong
-
buildClassifier
Method not in use- Specified by:
buildClassifier
in classClassifierSplitModel
-
weights
Method not in use- Specified by:
weights
in classClassifierSplitModel
-
sourceExpression
Method not in use- Specified by:
sourceExpression
in classClassifierSplitModel
-
getRevision
Returns the revision string.- Returns:
- the revision
-