weka.classifiers.trees
Class ExtraTree

java.lang.Object
  extended by weka.classifiers.AbstractClassifier
      extended by weka.classifiers.RandomizableClassifier
          extended by weka.classifiers.trees.ExtraTree
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Classifier, CapabilitiesHandler, OptionHandler, PartitionGenerator, Randomizable, RevisionHandler, TechnicalInformationHandler, WeightedInstancesHandler

public class ExtraTree
extends RandomizableClassifier
implements java.io.Serializable, OptionHandler, TechnicalInformationHandler, WeightedInstancesHandler, PartitionGenerator

Class for generating a single Extra-Tree. Use with the RandomCommittee meta classifier to generate an Extra-Trees forest for classification or regression. This classifier requires all predictors to be numeric. Missing values are not allowed. Instance weights are taken into account. For more information, see

Pierre Geurts, Damien Ernst, Louis Wehenkel (2006). Extremely randomized trees. Machine Learning. 63(1):3-42.

BibTeX:

 @article{Geurts2006,
    author = {Pierre Geurts and Damien Ernst and Louis Wehenkel},
    journal = {Machine Learning},
    number = {1},
    pages = {3-42},
    title = {Extremely randomized trees},
    volume = {63},
    year = {2006}
 }
 

Valid options are:

 -K <number of attributes>
  Number of attributes to randomly choose at a node. If values is -1, (m - 1) will be used for regression problems, and Math.rint(sqrt(m - 1)) for classification problems, where m is the number of predictors, as specified in Geurts et al. (default -1).
 -N <minimum number of instances>
  The minimum number of instances required at a node for splitting to be considered. If value is -1, 5 will be used for regression problems and 2 for classification problems, as specified in Geurts et al. (default -1).
 -S <num>
  Random number seed.
  (default 1)
 -D
  If set, classifier is run in debug mode and
  may output additional info to the console

Version:
$Revision: 9328 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
Serialized Form

Constructor Summary
ExtraTree()
           
 
Method Summary
 void buildClassifier(Instances data)
          Builds one tree.
 double[] distributionForInstance(Instance inst)
          Returns the distribution.
 void generatePartition(Instances data)
          Builds the classifier to generate a partition.
 Capabilities getCapabilities()
          Returns default capabilities of the classifier.
 int getK()
          Get the value of K.
 double[] getMembershipValues(Instance instance)
          Computes array that indicates node membership.
 int getNmin()
          Get the value of n_min.
 java.lang.String[] getOptions()
          Gets options from this classifier.
 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 kTipText()
          Returns the tip text for this property
 java.util.Enumeration listOptions()
          Lists the command-line options for this classifier.
static void main(java.lang.String[] args)
          Main method for this class.
 java.lang.String nminTipText()
          Returns the tip text for this property
 int numElements()
          Returns the number of elements in the partition.
 void setK(int k)
          Set the value of K.
 void setNmin(int n)
          Set the value of n_min.
 void setOptions(java.lang.String[] options)
          Parses a given list of options.
 java.lang.String toString()
          Returns classifier description.
 
Methods inherited from class weka.classifiers.RandomizableClassifier
getSeed, seedTipText, setSeed
 
Methods inherited from class weka.classifiers.AbstractClassifier
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtraTree

public ExtraTree()
Method Detail

globalInfo

public java.lang.String globalInfo()
Returns a string describing classifier

Returns:
a description suitable for displaying in the explorer/experimenter gui

getTechnicalInformation

public 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.

Specified by:
getTechnicalInformation in interface TechnicalInformationHandler
Returns:
the technical information about this class

kTipText

public java.lang.String kTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

getK

public int getK()
Get the value of K.

Returns:
Value of K.

setK

public void setK(int k)
Set the value of K.

Parameters:
k - value to assign to K.

nminTipText

public java.lang.String nminTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

getNmin

public int getNmin()
Get the value of n_min.

Returns:
Value of n_min.

setNmin

public void setNmin(int n)
Set the value of n_min.

Parameters:
k - value to assign to n_min.

listOptions

public java.util.Enumeration listOptions()
Lists the command-line options for this classifier.

Specified by:
listOptions in interface OptionHandler
Overrides:
listOptions in class RandomizableClassifier
Returns:
an enumeration over all possible options

getOptions

public java.lang.String[] getOptions()
Gets options from this classifier.

Specified by:
getOptions in interface OptionHandler
Overrides:
getOptions in class RandomizableClassifier
Returns:
the options for the current setup

setOptions

public void setOptions(java.lang.String[] options)
                throws java.lang.Exception
Parses a given list of options.

Valid options are:

 -K <number of attributes>
  Number of attributes to randomly choose at a node. If values is -1, (m - 1) will be used for regression problems, and Math.rint(sqrt(m - 1)) for classification problems, where m is the number of predictors, as specified in Geurts et al. (default -1).
 -N <minimum number of instances>
  The minimum number of instances required at a node for splitting to be considered. If value is -1, 5 will be used for regression problems and 2 for classification problems, as specified in Geurts et al. (default -1).
 -S <num>
  Random number seed.
  (default 1)
 -D
  If set, classifier is run in debug mode and
  may output additional info to the console

Specified by:
setOptions in interface OptionHandler
Overrides:
setOptions in class RandomizableClassifier
Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported

getCapabilities

public Capabilities getCapabilities()
Returns default capabilities of the classifier.

Specified by:
getCapabilities in interface Classifier
Specified by:
getCapabilities in interface CapabilitiesHandler
Overrides:
getCapabilities in class AbstractClassifier
Returns:
the capabilities of this classifier

buildClassifier

public void buildClassifier(Instances data)
                     throws java.lang.Exception
Builds one tree.

Specified by:
buildClassifier in interface Classifier
Throws:
java.lang.Exception

distributionForInstance

public double[] distributionForInstance(Instance inst)
Returns the distribution.

Specified by:
distributionForInstance in interface Classifier
Overrides:
distributionForInstance in class AbstractClassifier

toString

public java.lang.String toString()
Returns classifier description.

Overrides:
toString in class java.lang.Object

generatePartition

public void generatePartition(Instances data)
                       throws java.lang.Exception
Builds the classifier to generate a partition.

Specified by:
generatePartition in interface PartitionGenerator
Throws:
java.lang.Exception

getMembershipValues

public double[] getMembershipValues(Instance instance)
                             throws java.lang.Exception
Computes array that indicates node membership. Array locations are allocated based on breadth-first exploration of the tree.

Specified by:
getMembershipValues in interface PartitionGenerator
Throws:
java.lang.Exception

numElements

public int numElements()
                throws java.lang.Exception
Returns the number of elements in the partition.

Specified by:
numElements in interface PartitionGenerator
Throws:
java.lang.Exception

getRevision

public java.lang.String getRevision()
Returns the revision string.

Specified by:
getRevision in interface RevisionHandler
Overrides:
getRevision in class AbstractClassifier
Returns:
the revision

main

public static void main(java.lang.String[] args)
Main method for this class.