类 LeastMedSq

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

public class LeastMedSq extends Classifier implements OptionHandler, TechnicalInformationHandler
Implements a least median sqaured linear regression utilising the existing weka LinearRegression class to form predictions.
Least squared regression functions are generated from random subsamples of the data. The least squared regression with the lowest meadian squared error is chosen as the final model.

The basis of the algorithm is

Peter J. Rousseeuw, Annick M. Leroy (1987). Robust regression and outlier detection. .

BibTeX:

 @book{Rousseeuw1987,
    author = {Peter J. Rousseeuw and Annick M. Leroy},
    title = {Robust regression and outlier detection},
    year = {1987}
 }
 

Valid options are:

 -S <sample size>
  Set sample size
  (default: 4)
 
 -G <seed>
  Set the seed used to generate samples
  (default: 0)
 
 -D
  Produce debugging output
  (default no debugging output)
 
版本:
$Revision: 5523 $
作者:
Tony Voyle (tv6@waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • LeastMedSq

      public LeastMedSq()
  • 方法详细资料

    • globalInfo

      public String globalInfo()
      Returns a string describing this classifier
      返回:
      a description of the classifier 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
    • getCapabilities

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

      public void buildClassifier(Instances data) throws Exception
      Build lms regression
      指定者:
      buildClassifier 在类中 Classifier
      参数:
      data - training data
      抛出:
      Exception - if an error occurs
    • classifyInstance

      public double classifyInstance(Instance instance) throws Exception
      Classify a given instance using the best generated LinearRegression Classifier.
      覆盖:
      classifyInstance 在类中 Classifier
      参数:
      instance - instance to be classified
      返回:
      class value
      抛出:
      Exception - if an error occurs
    • toString

      public String toString()
      Returns a string representing the best LinearRegression classifier found.
      覆盖:
      toString 在类中 Object
      返回:
      String representing the regression
    • sampleSizeTipText

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

      public void setSampleSize(int samplesize)
      sets number of samples
      参数:
      samplesize - value
    • getSampleSize

      public int getSampleSize()
      gets number of samples
      返回:
      value
    • randomSeedTipText

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

      public void setRandomSeed(long randomseed)
      Set the seed for the random number generator
      参数:
      randomseed - the seed
    • getRandomSeed

      public long getRandomSeed()
      get the seed for the random number generator
      返回:
      the seed value
    • setDebug

      public void setDebug(boolean debug)
      sets whether or not debugging output shouild be printed
      覆盖:
      setDebug 在类中 Classifier
      参数:
      debug - true if debugging output selected
    • getDebug

      public boolean getDebug()
      Returns whether or not debugging output shouild be printed
      覆盖:
      getDebug 在类中 Classifier
      返回:
      true if debuging output selected
    • listOptions

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

      public void setOptions(String[] options) throws Exception
      Sets the OptionHandler's options using the given list. All options will be set (or reset) during this call (i.e. incremental setting of options is not possible). Valid options are:

       -S <sample size>
        Set sample size
        (default: 4)
       
       -G <seed>
        Set the seed used to generate samples
        (default: 0)
       
       -D
        Produce debugging output
        (default no debugging output)
       
      指定者:
      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 option settings for the OptionHandler.
      指定者:
      getOptions 在接口中 OptionHandler
      覆盖:
      getOptions 在类中 Classifier
      返回:
      the list of current option settings as an array of strings
    • combinations

      public static int combinations(int n, int r) throws Exception
      Produces the combination nCr
      参数:
      n -
      r -
      返回:
      the combination
      抛出:
      Exception - if r is greater than n
    • getRevision

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

      public static void main(String[] argv)
      generate a Linear regression predictor for testing
      参数:
      argv - options