Documentation of 'jsat.classifiers.RegressorToClassifier' Java class
RegressorToClassifier
jsat.classifiers

Class RegressorToClassifier

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


    public class RegressorToClassifier
    extends java.lang.Object
    implements BinaryScoreClassifier, Parameterized
    This meta algorithm wraps a Regressor to perform binary classification. This is done my labeling class 0 data points as "-1" and class 1 points as "1". The sign of the outputs then determines the class. Not all regression algorithms will work well in this setting, and standard parameter values need to change.
    The parameter values returned are exactly those provided by the given regressor, or an empty list if the regressor does not implement Parameterized
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      RegressorToClassifier(Regressor regressor)
      Creates a new Binary Classifier by using the given regressor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      CategoricalResults classify(DataPoint data)
      Performs classification on the given data point.
      RegressorToClassifier clone() 
      Parameter getParameter(java.lang.String paramName)
      Returns the parameter with the given name.
      java.util.List<Parameter> getParameters()
      Returns the list of parameters that can be altered for this learner.
      double getScore(DataPoint dp)
      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.
      boolean supportsWeightedData()
      Indicates whether the model knows how to train using weighted data points.
      void train(ClassificationDataSet dataSet)
      Trains the classifier and constructs a model for classification using the given data set.
      void train(ClassificationDataSet dataSet, boolean parallel)
      Trains the classifier and constructs a model for classification using the given data set.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RegressorToClassifier

        public RegressorToClassifier(Regressor regressor)
        Creates a new Binary Classifier by using the given regressor
        Parameters:
        regressor - the regressor to wrap as a binary classifier
    • Method Detail

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

        public java.util.List<Parameter> getParameters()
        Description copied from interface: Parameterized
        Returns the list of parameters that can be altered for this learner.
        Specified by:
        getParameters in interface Parameterized
        Returns:
        the list of parameters that can be altered for this learner.
      • getParameter

        public Parameter getParameter(java.lang.String paramName)
        Description copied from interface: Parameterized
        Returns the parameter with the given name. Two different strings may map to a single Parameter object. An ASCII only string, and a Unicode style string.
        Specified by:
        getParameter in interface Parameterized
        Parameters:
        paramName - the name of the parameter to obtain
        Returns:
        the Parameter in question, or null if no such named Parameter exists.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.