public class C45Split extends ClassifierSplitModel
Constructor and Description |
---|
C45Split(int attIndex,
int minNoObj,
double sumOfWeights,
boolean useMDLcorrection)
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 |
codingCost()
Returns coding cost for split (used in rule learner).
|
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..
|
double[][] |
minsAndMaxs(Instances data,
double[][] minsAndMaxs,
int index)
Returns the minsAndMaxs of the index.th subset.
|
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 |
splitPoint()
Returns the split point (numeric attribute only).
|
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, distribution, dumpLabel, dumpModel, numSubsets, setDistribution, sourceClass, split
public C45Split(int attIndex, int minNoObj, double sumOfWeights, boolean useMDLcorrection)
public void buildClassifier(Instances trainInstances) throws java.lang.Exception
buildClassifier
in class ClassifierSplitModel
java.lang.Exception
- if something goes wrongpublic final int attIndex()
public double splitPoint()
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 codingCost()
codingCost
in class ClassifierSplitModel
public final double gainRatio()
public final double infoGain()
public final java.lang.String leftSide(Instances data)
leftSide
in class ClassifierSplitModel
data
- training set.public final java.lang.String rightSide(int index, Instances data)
rightSide
in class ClassifierSplitModel
index
- of subsetdata
- 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 final double[][] minsAndMaxs(Instances data, double[][] minsAndMaxs, int index)
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()