Documentation of 'jsat.classifiers.svm.extended.CPM' Java class
CPM
jsat.classifiers.svm.extended

Class CPM

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


    public class CPM
    extends java.lang.Object
    implements BinaryScoreClassifier, Classifier, Parameterized
    This class implements the Convex Polytope Machine (CPM), which is an extension of the Linear SVM. It is a binary classifier that has training time proportionate to the linear case, but can obtain accuracies closer to that of a kernelized SVM.
    Similar to the AMM classifier, CPM uses multiple linear hyper-planes to create a non-linear classifier. Increasing the number of hyper-planes increases training/prediction time, but also increases the amount of non-linearity the model can tolerate.

    While the CPM implements the BinaryScoreClassifier interface, the CPM decision algorithm does not completely lend itself to producing a natural score in this manner. For this reason you may observe unusual behavior from the CPM if you rely on this interface, compared with other approaches.
    See: Kantchelian, A., Tschantz, M. C., Huang, L., Bartlett, P. L., Joseph, A. D., & Tygar, J. D. (2014). Large-margin Convex Polytope Machine. In Proceedings of the 27th International Conference on Neural Information Processing Systems (pp. 3248–3256). Cambridge, MA, USA: MIT Press. Retrieved from here
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      CPM()
      Creates a new CPM classifier, with default parameters that should work well for most cases.
      CPM(CPM toCopy)
      Copy constructor
      CPM(double lambda)
      Creates a new CPM classifier
      CPM(double lambda, int K)
      Creates a new CPM classifier
      CPM(double lambda, int K, double entropyThreshold)
      Creates a new CPM classifier
      CPM(double lambda, int K, double entropyThreshold, int epochs)
      Creates a new CPM classifier
      CPM(int K)
      Creates a new CPM classifier
    • Constructor Detail

      • CPM

        public CPM()
        Creates a new CPM classifier, with default parameters that should work well for most cases.
      • CPM

        public CPM(int K)
        Creates a new CPM classifier
        Parameters:
        K - the number of hyper-planes to learn with.
      • CPM

        public CPM(double lambda)
        Creates a new CPM classifier
        Parameters:
        lambda - the regularization parameter
      • CPM

        public CPM(double lambda,
                   int K)
        Creates a new CPM classifier
        Parameters:
        lambda - the regularization parameter
        K - the number of hyper-planes to learn with.
      • CPM

        public CPM(double lambda,
                   int K,
                   double entropyThreshold)
        Creates a new CPM classifier
        Parameters:
        lambda - the regularization parameter
        K - the number of hyper-planes to learn with.
        entropyThreshold - the parameter that encourages non-linearity to be exploited
      • CPM

        public CPM(double lambda,
                   int K,
                   double entropyThreshold,
                   int epochs)
        Creates a new CPM classifier
        Parameters:
        lambda - the regularization parameter
        K - the number of hyper-planes to learn with.
        entropyThreshold - the parameter that encourages non-linearity to be exploited
        epochs - the number of training iterations
      • CPM

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

      • setEntropyThreshold

        public void setEntropyThreshold(double entropyThreshold)
        Sets the entropy threshold used for training. It ensures a diversity of hyper-planes are used, where larger values encourage using more of the hyper planes.

        This method is adjusted from the paper's definition so that the input can be any non-negative value. It is recommended to try values in the range of [0, 10]
        Parameters:
        entropyThreshold - the non-negative parameter for hyper-plane diversity
      • getEntropyThreshold

        public double getEntropyThreshold()
        Returns:
        the non-negative parameter for hyper-plane diversity
      • setLambda

        public void setLambda(double lambda)
        Sets the regularization parameter λ to use. Larger values penalize model complexity. This value is adjusted from the form in the original paper so that you do not need to consider the number of epochs explicitly. The effective regularization will be divided by the total number of training updates.
        Parameters:
        lambda - the regularization parameter value to use, the recommended range range is (0, 104]
      • getLambda

        public double getLambda()
        Returns:
        the regularization parameter value
      • setK

        public void setK(int K)
        Sets the number of hyper planes to use when training. A normal linear model is equivalent to using only 1 hyper plane. The more hyper planes used, the more modeling capacity the algorithm has, but the slower it will run.
        Parameters:
        K - the number of hyper planes to use.
      • getK

        public int getK()
        Returns:
        the number of hyper planes to use.
      • setEpochs

        public void setEpochs(int epochs)
        Sets the number of whole iterations through the training set that will be performed for training
        Parameters:
        epochs - the number of whole iterations through the data set
      • getEpochs

        public int getEpochs()
        Returns the number of epochs used for training
        Returns:
        the number of epochs used for training
      • 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
      • 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
      • 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.
      • guessLambda

        public static Distribution guessLambda(DataSet d)
        Provides a distribution of reasonable values for the λ parameter
        Parameters:
        d - the dataset to get the guess for
        Returns:
        the distribution to search this parameter from
      • guessEntropyThreshold

        public static Distribution guessEntropyThreshold(DataSet d)
        Provides a distribution of reasonable values for the setEntropyThreshold(double) parameter
        Parameters:
        d - the dataset to get the guess for
        Returns:
        the distribution to search this parameter from

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.