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

Class EmphasisBoost

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


    public class EmphasisBoost
    extends java.lang.Object
    implements Classifier, Parameterized, BinaryScoreClassifier
    Emphasis Boost is a generalization of the Real AdaBoost algorithm, expanding the update term and providing the λ term to control the trade off. With λ = 1/2, it becomes equivalent to Real AdaBoost. If the weak learner does not support confidence outputs (non-hard decisions), then it further becomes equivalent to Discrete Ada Boost.
    Emphasis Boost only supports binary classification problems, the learner used should support weighted predictions.

    NOTE: In the face of extreme outliers, it is possible for numerical instability to occur. This implementation attempts to reset weights when numerical issues occur.

    See:
    Gómez-Verdejo, V., Ortega-Moral, M., Arenas-García, J.,&Figueiras-Vidal, A. R. (2006). Boosting by weighting critical and erroneous samples. Neurocomputing, 69(7-9), 679–685. doi:10.1016/j.neucom.2005.12.011
    See Also:
    Serialized Form
    • Constructor Detail

      • EmphasisBoost

        public EmphasisBoost()
        Creates a new EmphasisBooster with shallow decision trees and λ = 0.35
      • EmphasisBoost

        public EmphasisBoost(Classifier weakLearner,
                             int maxIterations,
                             double lambda)
        Creates a new EmphasisBoost learner
        Parameters:
        weakLearner - the weak learner to use
        maxIterations - the maximum number of boosting iterations
        lambda - the trade off parameter in [0, 1]
    • Method Detail

      • getModels

        public java.util.List<Classifier> getModels()
        Returns:
        a list of the models that are in this ensemble.
      • getModelWeights

        public java.util.List<java.lang.Double> getModelWeights()
        Returns:
        a list of the models weights that are in this ensemble.
      • getMaxIterations

        public int getMaxIterations()
        Returns the maximum number of iterations used
        Returns:
        the maximum number of iterations used
      • setMaxIterations

        public void setMaxIterations(int maxIterations)
        Sets the maximal number of boosting iterations that may be performed
        Parameters:
        maxIterations - the maximum number of iterations
      • getWeakLearner

        public Classifier getWeakLearner()
        Returns the weak learner currently being used by this method.
        Returns:
        the weak learner currently being used by this method.
      • setWeakLearner

        public void setWeakLearner(Classifier weakLearner)
        Sets the weak learner used during training.
        Parameters:
        weakLearner - the weak learner to use
      • guessLambda

        public static Distribution guessLambda(DataSet d)
        Guesses the distribution to use for the λ parameter
        Parameters:
        d - the dataset to get the guess for
        Returns:
        the guess for the λ parameter
        See Also:
        setLambda(double)
      • setLambda

        public void setLambda(double lambda)
        λ controls the trade off between weighting the errors based on their distance to the margin and the quadratic error of the output. The three extreme values are:
        • λ = 0 , in this case all the weight is placed on points based on their distance to the margin of the classification boundary.
        • λ = 1/2, in this case weight is balanced between the margin distance and the quadratic error. This is equivalent to Real Ada Boost
        • λ = 1, in this case the weight is placed purely based on the quadratic error of the output


        According to the original paper, values in the range [0.3, 0.4] often perform well.
        Parameters:
        lambda - the trade off parameter in [0, 1]
      • getLambda

        public double getLambda()
        Returns the value of the λ trade off parameter
        Returns:
        the value of the λ trade off parameter
      • getScore

        public double getScore(DataPoint dp)
        Description copied from interface: BinaryScoreClassifier
        Returns the numeric score for predicting a class of a given data point, where the sign of the value indicates which class the data point is predicted to belong to.
        Specified by:
        getScore in interface BinaryScoreClassifier
        Parameters:
        dp - the data point to predict the class label of
        Returns:
        the score for the given data point
      • 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
        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.