Documentation of 'jsat.classifiers.svm.SBP' Java class
SBP
jsat.classifiers.svm

Class SBP

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


    public class SBP
    extends SupportVectorLearner
    implements BinaryScoreClassifier, Parameterized
    Implementation of the Stochastic Batch Perceptron (SBP) algorithm. Despite its name, it solves the kernelized SVM problem. Because it is done stochastically, it may not produce Support Vectors that the standard SVM algorithm learns. It can learn at most one SV per iteration. See:
    Cotter, A., Shalev-Shwartz, S.,&Srebro, N. (2012). The Kernelized Stochastic Batch Perceptron. International Conference on Machine Learning. Learning. Retrieved from here
    See Also:
    Serialized Form
    • Constructor Detail

      • SBP

        public SBP(KernelTrick kernel,
                   SupportVectorLearner.CacheMode cacheMode,
                   int iterations,
                   double v)
        Creates a new SBP SVM learner
        Parameters:
        kernel - the kernel to use
        cacheMode - the type of kernel cache to use
    • Method Detail

      • setIterations

        public void setIterations(int iterations)
        Sets the number of iterations to go through. At most one SV can be learned per iteration. If more iterations are done than there are SVs, it is highly likely that O(n) SVs will be used, making the model very dense. It may take far fewer iterations of the algorithm than there are data points to get good accuracy.
        Parameters:
        iterations - the number of iterations of the algorithm to perform
      • getIterations

        public int getIterations()
        Returns the number of iterations the algorithm will perform
        Returns:
        the number of iterations the algorithm will perform
      • setNu

        public void setNu(double nu)
        The nu parameter for this SVM is not the same as the standard nu-SVM formulation, though it plays a similar role. It must be in the range (0, 1), where small values indicate a linearly separable problem (in the kernel space), and large values mean the problem is less separable. If the value is too small for the problem, the SVM may fail to converge or produce good results.
        Parameters:
        nu - the value between (0, 1)
      • getNu

        public double getNu()
        Returns the nu SVM parameter
        Returns:
        the nu SVM parameter
      • setBurnIn

        public void setBurnIn(double burnIn)
        Sets the burn in fraction. SBP averages the intermediate solutions from each step as the final solution. The intermediate steps of SBP are highly correlated, and the begging solutions are usually not as meaningful toward the converged solution. To overcome this issue a certain fraction of the iterations are not averaged into the final solution, making them the "burn in" fraction. A value of 0.25 would then be ignoring the initial 25% of solutions.
        Parameters:
        burnIn - the ratio int [0, 1) initial solutions to ignore
      • getBurnIn

        public double getBurnIn()
        Returns:
        the burn in fraction
      • 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.
      • 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
      • 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
        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.