类 SPegasos

java.lang.Object
weka.classifiers.Classifier
weka.classifiers.functions.SPegasos
所有已实现的接口:
Serializable, Cloneable, UpdateableClassifier, CapabilitiesHandler, OptionHandler, RevisionHandler, TechnicalInformationHandler

Implements the stochastic variant of the Pegasos (Primal Estimated sub-GrAdient SOlver for SVM) method of Shalev-Shwartz et al. (2007). This implementation globally replaces all missing values and transforms nominal attributes into binary ones. It also normalizes all attributes, so the coefficients in the output are based on the normalized data. For more information, see

S. Shalev-Shwartz, Y. Singer, N. Srebro: Pegasos: Primal Estimated sub-GrAdient SOlver for SVM. In: 24th International Conference on MachineLearning, 807-814, 2007.

BibTeX:

 @inproceedings{Shalev-Shwartz2007,
    author = {S. Shalev-Shwartz and Y. Singer and N. Srebro},
    booktitle = {24th International Conference on MachineLearning},
    pages = {807-814},
    title = {Pegasos: Primal Estimated sub-GrAdient SOlver for SVM},
    year = {2007}
 }
 

Valid options are:

 -L <double>
  The lambda regularization constant (default = 0.0001)
 -E <integer>
  The number of epochs to perform (batch learning only, default = 500)
 -N
  Don't normalize the data
 -M
  Don't replace missing values
版本:
$Revision: 6580 $
作者:
Mark Hall (mhall{[at]}pentaho{[dot]}com)
另请参阅:
  • 字段详细资料

    • TAGS_SELECTION

      public static final Tag[] TAGS_SELECTION
      Loss functions to choose from
  • 构造器详细资料

    • SPegasos

      public SPegasos()
  • 方法详细资料

    • getCapabilities

      public Capabilities getCapabilities()
      Returns default capabilities of the classifier.
      指定者:
      getCapabilities 在接口中 CapabilitiesHandler
      覆盖:
      getCapabilities 在类中 Classifier
      返回:
      the capabilities of this classifier
      另请参阅:
    • lambdaTipText

      public String lambdaTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setLambda

      public void setLambda(double lambda)
      Set the value of lambda to use
      参数:
      lambda - the value of lambda to use
    • getLambda

      public double getLambda()
      Get the current value of lambda
      返回:
      the current value of lambda
    • epochsTipText

      public String epochsTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setEpochs

      public void setEpochs(int e)
      Set the number of epochs to use
      参数:
      e - the number of epochs to use
    • getEpochs

      public int getEpochs()
      Get current number of epochs
      返回:
      the current number of epochs
    • setDontNormalize

      public void setDontNormalize(boolean m)
      Turn normalization off/on.
      参数:
      m - true if normalization is to be disabled.
    • getDontNormalize

      public boolean getDontNormalize()
      Get whether normalization has been turned off.
      返回:
      true if normalization has been disabled.
    • dontNormalizeTipText

      public String dontNormalizeTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setDontReplaceMissing

      public void setDontReplaceMissing(boolean m)
      Turn global replacement of missing values off/on. If turned off, then missing values are effectively ignored.
      参数:
      m - true if global replacement of missing values is to be turned off.
    • getDontReplaceMissing

      public boolean getDontReplaceMissing()
      Get whether global replacement of missing values has been disabled.
      返回:
      true if global replacement of missing values has been turned off
    • dontReplaceMissingTipText

      public String dontReplaceMissingTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setLossFunction

      public void setLossFunction(SelectedTag function)
      Set the loss function to use.
      参数:
      function - the loss function to use.
    • getLossFunction

      public SelectedTag getLossFunction()
      Get the current loss function.
      返回:
      the current loss function.
    • lossFunctionTipText

      public String lossFunctionTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • listOptions

      public Enumeration<Option> listOptions()
      Returns an enumeration describing the available options.
      指定者:
      listOptions 在接口中 OptionHandler
      覆盖:
      listOptions 在类中 Classifier
      返回:
      an enumeration of all the available options.
    • setOptions

      public void setOptions(String[] options) throws Exception
      Parses a given list of options.

      Valid options are:

       -L <double>
        The lambda regularization constant (default = 0.0001)
       -E <integer>
        The number of epochs to perform (batch learning only, default = 500)
       -N
        Don't normalize the data
       -M
        Don't replace missing values
      指定者:
      setOptions 在接口中 OptionHandler
      覆盖:
      setOptions 在类中 Classifier
      参数:
      options - the list of options as an array of strings
      抛出:
      Exception - if an option is not supported
    • getOptions

      public String[] getOptions()
      Gets the current settings of the classifier.
      指定者:
      getOptions 在接口中 OptionHandler
      覆盖:
      getOptions 在类中 Classifier
      返回:
      an array of strings suitable for passing to setOptions
    • globalInfo

      public String globalInfo()
      Returns a string describing classifier
      返回:
      a description suitable for displaying in the explorer/experimenter gui
    • getTechnicalInformation

      public TechnicalInformation getTechnicalInformation()
      Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
      指定者:
      getTechnicalInformation 在接口中 TechnicalInformationHandler
      返回:
      the technical information about this class
    • reset

      public void reset()
      Reset the classifier.
    • buildClassifier

      public void buildClassifier(Instances data) throws Exception
      Method for building the classifier.
      指定者:
      buildClassifier 在类中 Classifier
      参数:
      data - the set of training instances.
      抛出:
      Exception - if the classifier can't be built successfully.
    • updateClassifier

      public void updateClassifier(Instance instance) throws Exception
      Updates the classifier with the given instance.
      指定者:
      updateClassifier 在接口中 UpdateableClassifier
      参数:
      instance - the new training instance to include in the model
      抛出:
      Exception - if the instance could not be incorporated in the model.
    • distributionForInstance

      public double[] distributionForInstance(Instance inst) throws Exception
      Computes the distribution for a given instance
      覆盖:
      distributionForInstance 在类中 Classifier
      参数:
      instance - the instance for which distribution is computed
      返回:
      the distribution
      抛出:
      Exception - if the distribution can't be computed successfully
    • toString

      public String toString()
      Prints out the classifier.
      覆盖:
      toString 在类中 Object
      返回:
      a description of the classifier as a string
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      覆盖:
      getRevision 在类中 Classifier
      返回:
      the revision
    • main

      public static void main(String[] args)
      Main method for testing this class.