All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.classifiers.functions.pace.PaceRegression

java.lang.Object
    |
    +----weka.classifiers.Classifier
            |
            +----weka.classifiers.functions.pace.PaceRegression

public class PaceRegression
extends Classifier
implements OptionHandler, WeightedInstancesHandler
Class for building pace regression linear models and using them for prediction.

Under regularity conditions, pace regression is provably optimal when the number of coefficients tends to infinity. It consists of a group of estimators that are either overall optimal or optimal under certain conditions.

The current work of the pace regression theory, and therefore also this implementation, do not handle:

- missing values
- non-binary nominal attributes
- the case that n - k is small where n is number of instances and k is number of coefficients (the threshold used in this implmentation is 20)

Valid options are:

-D
Produce debugging output.

-E estimator
The estimator can be one of the following:

-S Threshold for the olsc estimator

REFERENCES

Wang, Y. (2000). "A new approach to fitting linear models in high dimensional spaces." PhD Thesis. Department of Computer Science, University of Waikato, New Zealand.

Wang, Y. and Witten, I. H. (2002). "Modeling for optimal probability prediction." Proceedings of ICML'2002. Sydney.

Version:
$Revision: 1.4 $
Author:
Yong Wang (yongwang@cs.waikato.ac.nz)
Author:
Gabi Schmidberger (gabi@cs.waikato.ac.nz)

Variable Index

 o TAGS_ESTIMATOR
 

Constructor Index

 o PaceRegression()
 

Method Index

 o buildClassifier(Instances)
Builds a pace regression model for the given data.
 o checkForMissing(Instance, Instances)
Checks if an instance has a missing value.
 o checkForMissing(Instances)
Checks if instances have a missing value.
 o checkForNonBinary(Instances)
Checks if any of the nominal attributes is non-binary.
 o classifyInstance(Instance)
Classifies the given instance using the linear regression function.
 o coefficients()
Returns the coefficients for this linear model.
 o getDebug()
Controls whether debugging output will be printed
 o getEstimator()
Gets the estimator
 o getOptions()
Gets the current settings of the classifier.
 o getThreshold()
Gets the threshold for olsc estimator
 o listOptions()
Returns an enumeration describing the available options.
 o main(String[])
Generates a linear regression function predictor.
 o numParameters()
Get the number of coefficients used in the model
 o setDebug(boolean)
Controls whether debugging output will be printed
 o setEstimator(SelectedTag)
Sets the estimator.
 o setOptions(String[])
Parses a given list of options.
 o setThreshold(double)
Set threshold for the olsc estimator
 o toString()
Outputs the linear regression model as a string.

Field Detail

 o TAGS_ESTIMATOR
public static final Tag[] TAGS_ESTIMATOR

Constructor Detail

 o PaceRegression
public PaceRegression()

Method Detail

 o buildClassifier
public void buildClassifier(Instances data) throws java.lang.Exception
          Builds a pace regression model for the given data.
Parameters:
data - the training data to be used for generating the linear regression function
Throws:
java.lang.Exception - if the classifier could not be built successfully
Overrides:
buildClassifier in class Classifier
 o checkForMissing
public boolean checkForMissing(Instances data)
          Checks if instances have a missing value.
Parameters:
data - the data set
Returns:
true if missing value is present in data set
 o checkForMissing
public boolean checkForMissing(Instance instance,
                               Instances model)
          Checks if an instance has a missing value.
Parameters:
instance - the instance
Returns:
true if missing value is present
 o checkForNonBinary
public boolean checkForNonBinary(Instances data)
          Checks if any of the nominal attributes is non-binary.
Parameters:
data - the data set
Returns:
true if non binary attribute is present
 o classifyInstance
public double classifyInstance(Instance instance) throws java.lang.Exception
          Classifies the given instance using the linear regression function.
Parameters:
instance - the test instance
Returns:
the classification
Throws:
java.lang.Exception - if classification can't be done successfully
Overrides:
classifyInstance in class Classifier
 o toString
public java.lang.String toString()
          Outputs the linear regression model as a string.
Overrides:
toString in class java.lang.Object
 o listOptions
public java.util.Enumeration listOptions()
          Returns an enumeration describing the available options.
Returns:
an enumeration of all the available options.
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
          Parses a given list of options.

Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported
 o coefficients
public double[] coefficients()
          Returns the coefficients for this linear model.
 o getOptions
public java.lang.String[] getOptions()
          Gets the current settings of the classifier.
Returns:
an array of strings suitable for passing to setOptions
 o numParameters
public int numParameters()
          Get the number of coefficients used in the model
Returns:
the number of coefficients
 o setDebug
public void setDebug(boolean debug)
          Controls whether debugging output will be printed
Parameters:
debug - true if debugging output should be printed
 o getDebug
public boolean getDebug()
          Controls whether debugging output will be printed
Parameters:
debug - true if debugging output should be printed
 o getEstimator
public SelectedTag getEstimator()
          Gets the estimator
Returns:
the estimator
 o setEstimator
public void setEstimator(SelectedTag estimator)
          Sets the estimator.
Parameters:
estimator - the new estimator
 o setThreshold
public void setThreshold(double newThreshold)
          Set threshold for the olsc estimator
Parameters:
threshold - the threshold for the olsc estimator
 o getThreshold
public double getThreshold()
          Gets the threshold for olsc estimator
Returns:
the threshold
 o main
public static void main(java.lang.String argv[])
          Generates a linear regression function predictor.
Parameters:
String - the options

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home