Documentation of 'jsat.classifiers.boosting.UpdatableStacking' Java class
UpdatableStacking
jsat.classifiers.boosting

Class UpdatableStacking

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Classifier, UpdateableClassifier, Regressor, UpdateableRegressor


    public class UpdatableStacking
    extends java.lang.Object
    implements UpdateableClassifier, UpdateableRegressor
    This provides an implementation of the Stacking ensemble method meant for Updatable models. Stacking learns several base classifiers and a top level classifier learns to predict the target based on the outputs of all the ensambled models. Historically a linear model (such as LinearBatch) is used, which translates to learning a weighted vote of the classifier outputs. However any classifier may be used so long as it supports the desired target type.

    Note, that Stacking tends to work best when the base classifiers produce reasonable probability estimates.
    Stacking supports weighted data instances if the aggregating model does.
    See: Wolpert, D. H. (1992). Stacked generalization. Neural Networks, 5, 241–259.
    See Also:
    Serialized Form
    • Constructor Detail

      • UpdatableStacking

        public UpdatableStacking(UpdateableClassifier aggregatingClassifier,
                                 java.util.List<UpdateableClassifier> baseClassifiers)
        Creates a new Stacking classifier
        Parameters:
        aggregatingClassifier - the classifier used to merge the results of all the input classifiers
        baseClassifiers - the list of base classifiers to ensemble
      • UpdatableStacking

        public UpdatableStacking(UpdateableClassifier aggregatingClassifier,
                                 UpdateableClassifier... baseClassifiers)
        Creates a new Stacking classifier.
        Parameters:
        aggregatingClassifier - the classifier used to merge the results of all the input classifiers
        baseClassifiers - the array of base classifiers to ensemble
      • UpdatableStacking

        public UpdatableStacking(UpdateableRegressor aggregatingRegressor,
                                 java.util.List<UpdateableRegressor> baseRegressors)
        Creates a new Stacking regressor
        Parameters:
        aggregatingRegressor - the regressor used to merge the results of all the input classifiers
        baseRegressors - the list of base regressors to ensemble
      • UpdatableStacking

        public UpdatableStacking(UpdateableRegressor aggregatingRegressor,
                                 UpdateableRegressor... baseRegressors)
        Creates a new Stacking regressor.
        Parameters:
        aggregatingRegressor - the regressor used to merge the results of all the input classifiers
        baseRegressors - the array of base regressors to ensemble
      • UpdatableStacking

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

      • 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.
      • update

        public void update(DataPoint dataPoint,
                           int targetClass)
        Description copied from interface: UpdateableClassifier
        Updates the classifier by giving it a new data point to learn from.
        Specified by:
        update in interface UpdateableClassifier
        Parameters:
        dataPoint - the data point to learn
        targetClass - the target class of the data point
      • update

        public void update(DataPoint dataPoint,
                           double targetValue)
        Description copied from interface: UpdateableRegressor
        Updates the classifier by giving it a new data point to learn from.
        Specified by:
        update in interface UpdateableRegressor
        Parameters:
        dataPoint - the data point to learn
        targetValue - the target value of the data point
      • 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.
      • train

        public void train(ClassificationDataSet dataSet)
        Description copied from interface: Classifier
        Trains the classifier and constructs a model for classification using the given data set.
        Specified by:
        train in interface Classifier
        Parameters:
        dataSet - the data set to train on
      • 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

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.