类 SimpleLinearRegression

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

public class SimpleLinearRegression extends Classifier implements WeightedInstancesHandler
Learns a simple linear regression model. Picks the attribute that results in the lowest squared error. Missing values are not allowed. Can only deal with numeric attributes.

Valid options are:

 -D
  If set, classifier is run in debug mode and
  may output additional info to the console
版本:
$Revision: 5523 $
作者:
Eibe Frank (eibe@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • SimpleLinearRegression

      public SimpleLinearRegression()
  • 方法详细资料

    • globalInfo

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

      public double classifyInstance(Instance inst) throws Exception
      Generate a prediction for the supplied instance.
      覆盖:
      classifyInstance 在类中 Classifier
      参数:
      inst - the instance to predict.
      返回:
      the prediction
      抛出:
      Exception - if an error occurs
    • getCapabilities

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

      public void buildClassifier(Instances insts) throws Exception
      Builds a simple linear regression model given the supplied training data.
      指定者:
      buildClassifier 在类中 Classifier
      参数:
      insts - the training data.
      抛出:
      Exception - if an error occurs
    • foundUsefulAttribute

      public boolean foundUsefulAttribute()
      Returns true if a usable attribute was found.
      返回:
      true if a usable attribute was found.
    • getAttributeIndex

      public int getAttributeIndex()
      Returns the index of the attribute used in the regression.
      返回:
      the index of the attribute.
    • getSlope

      public double getSlope()
      Returns the slope of the function.
      返回:
      the slope.
    • getIntercept

      public double getIntercept()
      Returns the intercept of the function.
      返回:
      the intercept.
    • setSuppressErrorMessage

      public void setSuppressErrorMessage(boolean s)
      Turn off the error message that is reported when no useful attribute is found.
      参数:
      s - if set to true turns off the error message
    • toString

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

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

      public static void main(String[] argv)
      Main method for testing this class
      参数:
      argv - options