Documentation of 'jsat.classifiers.linear.kernelized.BOGD' Java class
BOGD
jsat.classifiers.linear.kernelized

Class BOGD

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


    public class BOGD
    extends BaseUpdateableClassifier
    implements BinaryScoreClassifier, Parameterized
    Bounded Online Gradient Descent (BOGD) is a kernel learning algorithm that uses a bounded number of support vectors. Once the maximum number of support vectors is reached, old vectors are dropped either in a uniform random fashion, or weighted by the kernel function and the current coefficient for the vector. The later is the default method and is referred to as BOGD++.

    See: Zhao, P., Wang, J., Wu, P., Jin, R.,&Hoi, S. C. H. (2012). Fast Bounded Online Gradient Descent Algorithms for Scalable Kernel-Based Online Learning. In Proceedings of the 29th International Conference on Machine Learning (pp. 169–176). Learning; Machine Learning. Retrieved from here
    See Also:
    Serialized Form
    • Constructor Detail

      • BOGD

        public BOGD(KernelTrick k,
                    int budget,
                    double eta,
                    double reg,
                    double maxCoeff)
        Creates a new BOGD++ learner using the HingeLoss
        Parameters:
        k - the kernel trick to use
        budget - the budget for support vectors to allow
        eta - the learning rate to use
        reg - the regularization parameter
        maxCoeff - the maximum support vector coefficient to allow
      • BOGD

        public BOGD(KernelTrick k,
                    int budget,
                    double eta,
                    double reg,
                    double maxCoeff,
                    LossC lossC)
        Creates a new BOGD++ learner
        Parameters:
        k - the kernel trick to use
        budget - the budget for support vectors to allow
        eta - the learning rate to use
        reg - the regularization parameter
        maxCoeff - the maximum support vector coefficient to allow
        lossC - the loss function to use
      • BOGD

        public BOGD(BOGD toCopy)
        Copy constructor
        Parameters:
        toCopy - the object to make a copy of
    • Method Detail

      • setRegularization

        public void setRegularization(double regularization)
        Sets the regularization parameter used for training. The original paper suggests values in the range 2x/T2 for x ∈ {-3, -2, -1, 0, 1, 2, 3} where T is the number of data instances that will be trained on
        Parameters:
        regularization - the positive regularization parameter to use.
      • getRegularization

        public double getRegularization()
        Returns the regularization parameter used
        Returns:
        the regularization parameter used
      • setEta

        public void setEta(double eta)
        Sets the learning rate to use for training. The original paper suggests values in the range 2x for x ∈ {-3, -2, -1, 0, 1, 2, 3}
        Parameters:
        eta - the positive learning rate to use
      • getEta

        public double getEta()
        Returns the learning rate in use
        Returns:
        the learning rate in use
      • setMaxCoeff

        public void setMaxCoeff(double maxCoeff)
        Sets the maximum allowed value for any support vector allowed. The original paper suggests values in the range 2x for x ∈ {0, 1, 2, 3, 4}
        Parameters:
        maxCoeff - the maximum value for any support vector
      • getMaxCoeff

        public double getMaxCoeff()
        Returns the maximum allowed value for any support vector
        Returns:
        the maximum allowed value for any support vector
      • setBudget

        public void setBudget(int budget)
        Sets the budget for support vectors
        Parameters:
        budget - the allowed budget for support vectors
      • getBudget

        public int getBudget()
        Returns the maximum number of allowed support vectors
        Returns:
        the maximum number of allowed support vectors
      • setKernel

        public void setKernel(KernelTrick k)
        Sets the kernel to use
        Parameters:
        k - the kernel to use
      • getKernel

        public KernelTrick getKernel()
        Returns the kernel to use
        Returns:
        the kernel to use
      • setUniformSampling

        public void setUniformSampling(boolean uniformSampling)
        Sets whether or not support vectors should be removed by uniform sampling or not. The default is false, which corresponds to BOGD++.
        Parameters:
        uniformSampling - true to use uniform sampling, false otherwise.
      • isUniformSampling

        public boolean isUniformSampling()
        Returns true is uniform sampling is in use, or false if the BOGD++ sampling procedure is in use
        Returns:
        true is uniform sampling is in use, or false if the BOGD++ sampling procedure is in use
      • 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
      • 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
      • 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.
      • 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
      • guessRegularization

        public static Distribution guessRegularization(DataSet d)
        Guesses the distribution to use for the Regularization parameter
        Parameters:
        d - the dataset to get the guess for
        Returns:
        the guess for the Regularization parameter
        See Also:
        setRegularization(double)
      • guessEta

        public static Distribution guessEta(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:
        setEta(double)
      • guessMaxCoeff

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

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.