public class ResidualSplit extends ClassifierSplitModel
Modifier and Type | Field and Description |
---|---|
protected int |
m_attIndex
The index of the attribute selected for the split
|
protected Attribute |
m_attribute
The attribute selected for the split
|
protected Instances |
m_data
The set of instances
|
protected double[][] |
m_dataWs
The LogitBoost-weights for the set of instances
|
protected double[][] |
m_dataZs
The Z-values (LogitBoost response) for the set of instances
|
protected int |
m_numClasses
Number of classed
|
protected int |
m_numInstances
Number of instances in the set
|
protected double |
m_splitPoint
The split point (for numeric attributes)
|
m_distribution, m_numSubsets
Constructor and Description |
---|
ResidualSplit(int attIndex)
Creates a split object
|
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances data)
Method not in use
|
void |
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.
|
protected double |
entropy(double[][] dataZs,
double[][] dataWs)
Helper function to compute entropy from Z/W values.
|
double |
entropyGain()
Computes entropy gain for current split.
|
String |
getRevision()
Returns the revision string.
|
protected boolean |
getSplitPoint()
Selects split point for numeric attribute.
|
String |
leftSide(Instances data)
Returns name of splitting attribute (left side of condition).
|
String |
rightSide(int index,
Instances data)
Prints the condition satisfied by instances in a subset.
|
String |
sourceExpression(int index,
Instances data)
Method not in use
|
double[] |
weights(Instance instance)
Method not in use
|
int |
whichSubset(Instance instance)
Returns index of subset instance is assigned to.
|
checkModel, classifyInstance, classProb, classProbLaplace, clone, codingCost, distribution, dumpLabel, dumpModel, numSubsets, resetDistribution, sourceClass, split
protected Attribute m_attribute
protected int m_attIndex
protected int m_numInstances
protected int m_numClasses
protected Instances m_data
protected double[][] m_dataZs
protected double[][] m_dataWs
protected double m_splitPoint
public ResidualSplit(int attIndex)
attIndex
- the index of the attribute to split onpublic void buildClassifier(Instances data, double[][] dataZs, double[][] dataWs) throws Exception
Exception
protected boolean getSplitPoint() throws Exception
Exception
public double entropyGain() throws Exception
Exception
protected double entropy(double[][] dataZs, double[][] dataWs)
public boolean checkModel(int minNumInstances)
public final String leftSide(Instances data)
leftSide
in class ClassifierSplitModel
data
- the data.public final String rightSide(int index, Instances data)
rightSide
in class ClassifierSplitModel
public final int whichSubset(Instance instance) throws Exception
ClassifierSplitModel
whichSubset
in class ClassifierSplitModel
Exception
- if something goes wrongpublic void buildClassifier(Instances data)
buildClassifier
in class ClassifierSplitModel
public final double[] weights(Instance instance)
weights
in class ClassifierSplitModel
public final String sourceExpression(int index, Instances data)
sourceExpression
in class ClassifierSplitModel
public String getRevision()
Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.