Class DecisionStump
java.lang.Object
Classifier
DecisionStump
public class DecisionStump
- extends Classifier
The DecisionStump class implements a 1-level decision tree
- Author:
- John MacCormick
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DecisionStump
public DecisionStump(AttributeSet attributeSet)
- Parameters:
attributeSet
- the set of attributes used by the machine learning problem
which this decision stump will tackle
DecisionStump
public DecisionStump(AttributeSet attributeSet,
java.util.ArrayList<Attribute> availableAttributes)
- Parameters:
attributeSet
- the set of attributes used by the machine learning problem
which this decision stump will tackleavailableAttributes
- A list of attributes from which this decision stump is
permitted to choose (it will choose to split the data on the
attribute that results in the lowest expected entropy).
learn
public void learn(InstanceSet trainingSet)
- Description copied from class:
Classifier
- Learn a classifier from the given training set
- Specified by:
learn
in class Classifier
- Parameters:
trainingSet
- the training set from which to learn the classifier
decide
public java.lang.String decide(Instance instance)
- Specified by:
decide
in class Classifier
- Parameters:
instance
- the instance whose class is to be decided
- Returns:
- the class value of the instance
computeClassProbabilities
public java.util.Hashtable<java.lang.String,java.lang.Double> computeClassProbabilities(Instance instance)
- Specified by:
computeClassProbabilities
in class Classifier
- Parameters:
instance
- the instance whose class probabilities are to be computed
- Returns:
- a table mapping class values to their probabilities
print
public void print()
- Description copied from class:
Classifier
- print out a legible form of the classifier
- Specified by:
print
in class Classifier
getAvailableAttributes
public java.util.ArrayList<Attribute> getAvailableAttributes()
- Returns:
- the list of attributes from which this decision stump is
permitted to choose (it will choose to split the data on the
attribute that results in the lowest expected entropy)
getBestAttribute
public Attribute getBestAttribute()
- Returns:
- the bestAttribute
getNumErrors
public int getNumErrors()