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

Class ERTrees

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


    public class ERTrees
    extends ExtraTree
    Extra Randomized Trees (ERTrees) is an ensemble method built on top of ExtraTree. The randomness of the trees provides incredibly high variance, yet a low bias. The sum of many randomized trees proves to be a powerful and fast learner.
    The default settings are those suggested in the paper. However, the default stop size suggested (especially for classification) is often too small. You may want to consider increasing it if the accuracy is too low.
    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

      • ERTrees

        public ERTrees()
        Creates a new Extremely Randomized Trees learner
      • ERTrees

        public ERTrees(int forrestSize)
        Creates a new Extremely Randomized Trees learner
        Parameters:
        forrestSize - the number of trees to construct
      • ERTrees

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

      • evaluateFeatureImportance

        public <Type extends DataSetOnLineStatistics[] evaluateFeatureImportance(DataSet<Type> data)
        Measures the statistics of feature importance from the trees in this forest. For classification datasets, the MDI method with Gini impurity will be used. For others, the ImportanceByUses method will be used. This may change in the future.
        Type Parameters:
        Type -
        Parameters:
        data - the dataset to infer the feature importance from with respect to the current model.
        Returns:
        an array of statistics, which each index corresponds to a specific feature. Numeric features start from the zero index, categorical features start from the index equal to the number of numeric features.
      • evaluateFeatureImportance

        public <Type extends DataSetOnLineStatistics[] evaluateFeatureImportance(DataSet<Type> data,
                                                                                   TreeFeatureImportanceInference imp)
        Measures the statistics of feature importance from the trees in this forest.
        Type Parameters:
        Type -
        Parameters:
        data - the dataset to infer the feature importance from with respect to the current model.
        imp - the method of determing the feature importance that will be applied to each tree in this model
        Returns:
        an array of statistics, which each index corresponds to a specific feature. Numeric features start from the zero index, categorical features start from the index equal to the number of numeric features.
      • setUseDefaultSelectionCount

        public void setUseDefaultSelectionCount(boolean useDefaultSelectionCount)
        Sets whether or not to use the default heuristic for the number of random features to select as candidates for each node. If true the value of selectionCount will be modified during training, using sqrt(n) features for classification and all features for regression. Otherwise, whatever value set before hand will be used.
        Parameters:
        useDefaultSelectionCount - whether or not to use the heuristic version
      • getUseDefaultSelectionCount

        public boolean getUseDefaultSelectionCount()
        Returns if the default heuristic for the selection count is used
        Returns:
        if the default heuristic for the selection count is used
      • setUseDefaultStopSize

        public void setUseDefaultStopSize(boolean useDefaultStopSize)
        Sets whether or not to us the default heuristic for the number of points to force a new node to be a leaf. If true the value for stopSize will be altered during training, set to 2 for classification and 5 for regression. Otherwise, whatever value set beforehand will be used.
        Parameters:
        useDefaultStopSize - whether or not to use the heuristic version
      • getUseDefaultStopSize

        public boolean getUseDefaultStopSize()
        Returns if the default heuristic for the stop size is used
        Returns:
        if the default heuristic for the stop size is used
      • setForrestSize

        public void setForrestSize(int forrestSize)
      • getForrestSize

        public int getForrestSize()
      • 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
        Overrides:
        train in class ExtraTree
        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
        Overrides:
        supportsWeightedData in class ExtraTree
        Returns:
        true if the model supports weighted data, false otherwise

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.