Package weka.classifiers.trees
Class LADTree
java.lang.Object
weka.classifiers.Classifier
weka.classifiers.trees.LADTree
- All Implemented Interfaces:
Serializable,Cloneable,AdditionalMeasureProducer,CapabilitiesHandler,Drawable,OptionHandler,RevisionHandler,TechnicalInformationHandler
public class LADTree
extends Classifier
implements Drawable, AdditionalMeasureProducer, TechnicalInformationHandler
Class for generating a multi-class alternating decision tree using the LogitBoost strategy. For more info, see
Geoffrey Holmes, Bernhard Pfahringer, Richard Kirkby, Eibe Frank, Mark Hall: Multiclass alternating decision trees. In: ECML, 161-172, 2001. BibTeX:
Geoffrey Holmes, Bernhard Pfahringer, Richard Kirkby, Eibe Frank, Mark Hall: Multiclass alternating decision trees. In: ECML, 161-172, 2001. BibTeX:
@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
- Version:
- $Revision: 10279 $
- Author:
- Richard Kirkby
- See Also:
-
Field Summary
Fields inherited from interface weka.core.Drawable
BayesNet, Newick, NOT_DRAWABLE, TREE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildClassifier(Instances instances) Builds a classifier for a set of instances.double[]distributionForInstance(Instance instance) Returns the class probability distribution for an instance.voiddone()Returns an enumeration of the additional measure names.Returns default capabilities of the classifier.doublegetMeasure(String additionalMeasureName) Returns the value of the named measure.intGets the number of boosting iterations.String[]Gets the current settings of ADTree.Returns the revision string.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.Returns a string describing classifiergraph()Returns graph describing the tree.intReturns the type of graph this classifier represents.voidinitClassifier(Instances instances) Sets up the tree ready to be trained.legend()Returns the legend of the tree, describing how results are to be interpreted.Returns an enumeration describing the available options.static voidMain method for testing this class.doubleReturns the number of examples "counted".doubleReturns the number of nodes expanded.doubleCalls measure function for leaf size.doubleCalls measure function for leaf size.doubleCalls measure function for tree size.voidMerges two trees together.voidnext(int iteration) intpredictiveError(Instances test) voidsetNumOfBoostingIterations(int b) Sets the number of boosting iterations.voidsetOptions(String[] options) Parses a given list of options.toString()Returns a description of the classifier.Methods inherited from class weka.classifiers.Classifier
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug
-
Constructor Details
-
LADTree
public LADTree()
-
-
Method Details
-
globalInfo
Returns a string describing classifier- Returns:
- a description suitable for displaying in the explorer/experimenter gui
-
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.- Specified by:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
initClassifier
Sets up the tree ready to be trained.- Parameters:
instances- the instances to train the tree with- Throws:
Exception- if training data is unsuitable
-
next
- Throws:
Exception
-
done
- Throws:
Exception
-
distributionForInstance
Returns the class probability distribution for an instance.- Overrides:
distributionForInstancein classClassifier- Parameters:
instance- the instance to be classified- Returns:
- the distribution the tree generates for the instance
-
toString
Returns a description of the classifier. -
graph
Returns graph describing the tree. -
legend
Returns the legend of the tree, describing how results are to be interpreted.- Returns:
- a string containing the legend of the classifier
-
numOfBoostingIterationsTipText
- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getNumOfBoostingIterations
public int getNumOfBoostingIterations()Gets the number of boosting iterations.- Returns:
- the number of boosting iterations
-
setNumOfBoostingIterations
public void setNumOfBoostingIterations(int b) Sets the number of boosting iterations.- Parameters:
b- the number of boosting iterations to use
-
listOptions
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Overrides:
listOptionsin classClassifier- Returns:
- an enumeration of all the available options
-
setOptions
Parses a given list of options. Valid options are:-B num
Set the number of boosting iterations (default 10)- Specified by:
setOptionsin interfaceOptionHandler- Overrides:
setOptionsin classClassifier- Parameters:
options- the list of options as an array of strings- Throws:
Exception- if an option is not supported
-
getOptions
Gets the current settings of ADTree.- Specified by:
getOptionsin interfaceOptionHandler- Overrides:
getOptionsin classClassifier- Returns:
- an array of strings suitable for passing to setOptions()
-
measureTreeSize
public double measureTreeSize()Calls measure function for tree size.- Returns:
- the tree size
-
measureNumLeaves
public double measureNumLeaves()Calls measure function for leaf size.- Returns:
- the leaf size
-
measureNumPredictionLeaves
public double measureNumPredictionLeaves()Calls measure function for leaf size.- Returns:
- the leaf size
-
measureNodesExpanded
public double measureNodesExpanded()Returns the number of nodes expanded.- Returns:
- the number of nodes expanded during search
-
measureExamplesCounted
public double measureExamplesCounted()Returns the number of examples "counted".- Returns:
- the number of nodes processed during search
-
enumerateMeasures
Returns an enumeration of the additional measure names.- Specified by:
enumerateMeasuresin interfaceAdditionalMeasureProducer- Returns:
- an enumeration of the measure names
-
getMeasure
Returns the value of the named measure.- Specified by:
getMeasurein interfaceAdditionalMeasureProducer- Parameters:
measureName- the name of the measure to query for its value- Returns:
- the value of the named measure
- Throws:
IllegalArgumentException- if the named measure is not supported
-
buildClassifier
Builds a classifier for a set of instances.- Specified by:
buildClassifierin classClassifier- Parameters:
instances- the instances to train the classifier with- Throws:
Exception- if something goes wrong
-
predictiveError
-
merge
Merges two trees together. Modifies the tree being acted on, leaving tree passed as a parameter untouched (cloned). Does not check to see whether training instances are compatible - strange things could occur if they are not.- Parameters:
mergeWith- the tree to merge with- Throws:
Exception- if merge could not be performed
-
graphType
public int graphType()Returns the type of graph this classifier represents. -
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classClassifier- Returns:
- the revision
-
getCapabilities
Returns default capabilities of the classifier.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Overrides:
getCapabilitiesin classClassifier- Returns:
- the capabilities of this classifier
- See Also:
-
main
Main method for testing this class.- Parameters:
argv- the options
-