Documentation of 'jsat.classifiers.trees.ExtraTree' Java class
ExtraTree
jsat.classifiers.trees

Class ExtraTree

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Classifier, TreeLearner, Parameterized, Regressor
    Direct Known Subclasses:
    ERTrees


    public class ExtraTree
    extends java.lang.Object
    implements Classifier, Regressor, TreeLearner, Parameterized
    The ExtraTree is an Extremely Randomized Tree. Splits are chosen at random, and the features that are selected are also chosen at random for each new node in the tree.
    If set to randomly select one feature for each node, it becomes a Totally Randomized Tree
    See:
    Geurts, P., Ernst, D.,&Wehenkel, L. (2006). Extremely randomized trees . Machine learning, 63(1), 3–42. doi:10.1007/s10994-006-6226-1
    See Also:
    Serialized Form
    • Constructor Detail

      • ExtraTree

        public ExtraTree()
        Creates a new Extra Tree that will use all features in the training set
      • ExtraTree

        public ExtraTree(int selectionCount,
                         int stopSize)
        Creates a new Extra Tree
        Parameters:
        selectionCount - the number of features to select
        stopSize - the stop size
      • ExtraTree

        public ExtraTree(ExtraTree toCopy)
        Copy constructor.
        Parameters:
        toCopy - the object to copy
    • Method Detail

      • setImpurityMeasure

        public void setImpurityMeasure(ImpurityScore.ImpurityMeasure impurityMeasure)
        Sets the impurity measure used during classification tree construction to select the best of the features.
        Parameters:
        impurityMeasure - the impurity measure to use
      • getImpurityMeasure

        public ImpurityScore.ImpurityMeasure getImpurityMeasure()
        Returns the impurity measure in use
        Returns:
        the impurity measure in use
      • setStopSize

        public void setStopSize(int stopSize)
        Sets the stopping size for tree growth. When a node has less than or equal to stopSize data points to train from, it terminates and produces a leaf node.
        Parameters:
        stopSize - the size of the testing set to refuse to split
      • getStopSize

        public int getStopSize()
        Returns the stopping size for tree growth
        Returns:
        the stopping size for tree growth
      • setSelectionCount

        public void setSelectionCount(int selectionCount)
        The ExtraTree will select the best of a random subset of features at each level, this sets the number of random features to select. If set larger than the number of features in the training set, all features will be eligible for selection at every level.
        Parameters:
        selectionCount - the number of random features to select
      • getSelectionCount

        public int getSelectionCount()
        Returns the number of random features chosen at each level in the tree
        Returns:
        the number of random features to chose
      • setBinaryCategoricalSplitting

        public void setBinaryCategoricalSplitting(boolean binaryCategoricalSplitting)
        The normal implementation of ExtraTree always produces binary splits, including for categorical features. If set to false categorical features will expand out for each value in the category. This reduces the randomness of the tree.
        Parameters:
        binaryCategoricalSplitting - whether or not to use the original splitting algorithm, or to fully expand nominal features
      • isBinaryCategoricalSplitting

        public boolean isBinaryCategoricalSplitting()
        Returns whether or not binary splitting is used for nominal features
        Returns:
        whether or not binary splitting is used for nominal features
      • classify

        public CategoricalResults classify(DataPoint data)
        Description copied from interface: Classifier
        Performs classification on the given data point.
        Specified by:
        classify in interface Classifier
        Parameters:
        data - the data point to classify
        Returns:
        the results of the classification.
      • train

        public void train(ClassificationDataSet dataSet,
                          boolean parallel)
        Description copied from interface: Classifier
        Trains the classifier and constructs a model for classification using the given data set. If the training method knows how, it will used the threadPool to conduct training in parallel. This method will block until the training has completed.
        Specified by:
        train in interface Classifier
        Parameters:
        dataSet - the data set to train on
        parallel - true if multiple threads should be used to train the model. false if it should be done in a single threaded manner.
      • supportsWeightedData

        public boolean supportsWeightedData()
        Description copied from interface: Classifier
        Indicates whether the model knows how to train using weighted data points. If it does, the model will train assuming the weights. The values returned by this method may change depending on the parameters set for the model.
        Specified by:
        supportsWeightedData in interface Classifier
        Specified by:
        supportsWeightedData in interface Regressor
        Returns:
        true if the model supports weighted data, false otherwise
      • getTreeNodeVisitor

        public TreeNodeVisitor getTreeNodeVisitor()
        Description copied from interface: TreeLearner
        Obtains a node visitor for the tree learner that can be used to traverse and predict from the learned tree
        Specified by:
        getTreeNodeVisitor in interface TreeLearner
        Returns:
        the root node visitor for the learned tree

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.