public class BinC45Split extends ClassifierSplitModel
Constructor and Description |
---|
BinC45Split(int attIndex,
int minNoObj,
double sumOfWeights)
Initializes the split model.
|
Modifier and Type | Method and Description |
---|---|
int |
attIndex()
Returns index of attribute for which split was generated.
|
void |
buildClassifier(Instances trainInstances)
Creates a C4.5-type split on the given data.
|
double |
classProb(int classIndex,
Instance instance,
int theSubset)
Gets class probability for instance.
|
double |
gainRatio()
Returns (C4.5-type) gain ratio for the generated split.
|
java.lang.String |
getRevision()
Returns the revision string.
|
double |
infoGain()
Returns (C4.5-type) information gain for the generated split.
|
java.lang.String |
leftSide(Instances data)
Prints left side of condition.
|
void |
resetDistribution(Instances data)
Sets distribution associated with model.
|
java.lang.String |
rightSide(int index,
Instances data)
Prints the condition satisfied by instances in a subset.
|
void |
setSplitPoint(Instances allInstances)
Sets split point to greatest value in given data smaller or equal to
old split point.
|
java.lang.String |
sourceExpression(int index,
Instances data)
Returns a string containing java source code equivalent to the test
made at this node.
|
double[] |
weights(Instance instance)
Returns weights if instance is assigned to more than one subset.
|
int |
whichSubset(Instance instance)
Returns index of subset instance is assigned to.
|
checkModel, classifyInstance, classProbLaplace, clone, codingCost, distribution, dumpLabel, dumpModel, numSubsets, sourceClass, split
public BinC45Split(int attIndex, int minNoObj, double sumOfWeights)
public void buildClassifier(Instances trainInstances) throws java.lang.Exception
buildClassifier
in class ClassifierSplitModel
java.lang.Exception
- if something goes wrongpublic final int attIndex()
public final double gainRatio()
public final double classProb(int classIndex, Instance instance, int theSubset) throws java.lang.Exception
classProb
in class ClassifierSplitModel
java.lang.Exception
- if something goes wrongpublic final double infoGain()
public final java.lang.String leftSide(Instances data)
leftSide
in class ClassifierSplitModel
data
- the data to get the attribute name from.public final java.lang.String rightSide(int index, Instances data)
rightSide
in class ClassifierSplitModel
index
- of subset and training set.public final java.lang.String sourceExpression(int index, Instances data)
sourceExpression
in class ClassifierSplitModel
index
- index of the nominal value testeddata
- the data containing instance structure infopublic final void setSplitPoint(Instances allInstances)
public void resetDistribution(Instances data) throws java.lang.Exception
resetDistribution
in class ClassifierSplitModel
java.lang.Exception
public final double[] weights(Instance instance)
weights
in class ClassifierSplitModel
public final int whichSubset(Instance instance) throws java.lang.Exception
whichSubset
in class ClassifierSplitModel
java.lang.Exception
- if something goes wrongpublic java.lang.String getRevision()