public class LADTree extends Classifier implements Drawable, AdditionalMeasureProducer, TechnicalInformationHandler
@inproceedings{Holmes2001, author = {Geoffrey Holmes and Bernhard Pfahringer and Richard Kirkby and Eibe Frank and Mark Hall}, booktitle = {ECML}, pages = {161-172}, publisher = {Springer}, title = {Multiclass alternating decision trees}, year = {2001} }Valid options are:
-B <number of boosting iterations> Number of boosting iterations. (Default = 10)
-D If set, classifier is run in debug mode and may output additional info to the console
BayesNet, Newick, NOT_DRAWABLE, TREE
Constructor and Description |
---|
LADTree() |
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances instances)
Builds a classifier for a set of instances.
|
double[] |
distributionForInstance(Instance instance)
Returns the class probability distribution for an instance.
|
void |
done() |
java.util.Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names.
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure.
|
int |
getNumOfBoostingIterations()
Gets the number of boosting iterations.
|
java.lang.String[] |
getOptions()
Gets the current settings of ADTree.
|
java.lang.String |
getRevision()
Returns the revision string.
|
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing
detailed information about the technical background of this class,
e.g., paper reference or book this class is based on.
|
java.lang.String |
globalInfo()
Returns a string describing classifier
|
java.lang.String |
graph()
Returns graph describing the tree.
|
int |
graphType()
Returns the type of graph this classifier
represents.
|
void |
initClassifier(Instances instances)
Sets up the tree ready to be trained.
|
java.lang.String |
legend()
Returns the legend of the tree, describing how results are to be interpreted.
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
double |
measureExamplesCounted()
Returns the number of examples "counted".
|
double |
measureNodesExpanded()
Returns the number of nodes expanded.
|
double |
measureNumLeaves()
Calls measure function for leaf size.
|
double |
measureNumPredictionLeaves()
Calls measure function for leaf size.
|
double |
measureTreeSize()
Calls measure function for tree size.
|
void |
merge(LADTree mergeWith)
Merges two trees together.
|
void |
next(int iteration) |
java.lang.String |
numOfBoostingIterationsTipText() |
int |
predictiveError(Instances test) |
void |
setNumOfBoostingIterations(int b)
Sets the number of boosting iterations.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
java.lang.String |
toString()
Returns a description of the classifier.
|
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public void initClassifier(Instances instances) throws java.lang.Exception
instances
- the instances to train the tree withjava.lang.Exception
- if training data is unsuitablepublic void next(int iteration) throws java.lang.Exception
java.lang.Exception
public void done() throws java.lang.Exception
java.lang.Exception
public double[] distributionForInstance(Instance instance)
distributionForInstance
in class Classifier
instance
- the instance to be classifiedpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String graph() throws java.lang.Exception
public java.lang.String legend()
public java.lang.String numOfBoostingIterationsTipText()
public int getNumOfBoostingIterations()
public void setNumOfBoostingIterations(int b)
b
- the number of boosting iterations to usepublic java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class Classifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-B num
Set the number of boosting iterations
(default 10)
setOptions
in interface OptionHandler
setOptions
in class Classifier
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class Classifier
public double measureTreeSize()
public double measureNumLeaves()
public double measureNumPredictionLeaves()
public double measureNodesExpanded()
public double measureExamplesCounted()
public java.util.Enumeration enumerateMeasures()
enumerateMeasures
in interface AdditionalMeasureProducer
public double getMeasure(java.lang.String additionalMeasureName)
getMeasure
in interface AdditionalMeasureProducer
measureName
- the name of the measure to query for its valuejava.lang.IllegalArgumentException
- if the named measure is not supportedpublic void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- the instances to train the classifier withjava.lang.Exception
- if something goes wrongpublic int predictiveError(Instances test)
public void merge(LADTree mergeWith) throws java.lang.Exception
mergeWith
- the tree to merge withjava.lang.Exception
- if merge could not be performedpublic int graphType()
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Classifier
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Classifier
Capabilities
public static void main(java.lang.String[] argv)
argv
- the options