|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.functions.LeastMedSq
public class LeastMedSq
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. .
@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)
| Constructor Summary | |
|---|---|
LeastMedSq()
|
|
| Method Summary | |
|---|---|
void |
buildClassifier(Instances data)
Build lms regression |
double |
classifyInstance(Instance instance)
Classify a given instance using the best generated LinearRegression Classifier. |
static int |
combinations(int n,
int r)
Produces the combination nCr |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
boolean |
getDebug()
Returns whether or not debugging output shouild be printed |
java.lang.String[] |
getOptions()
Gets the current option settings for the OptionHandler. |
long |
getRandomSeed()
get the seed for the random number generator |
java.lang.String |
getRevision()
Returns the revision string. |
int |
getSampleSize()
gets number of samples |
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. |
java.lang.String |
globalInfo()
Returns a string describing this classifier |
java.util.Enumeration |
listOptions()
Returns an enumeration of all the available options.. |
static void |
main(java.lang.String[] argv)
generate a Linear regression predictor for testing |
java.lang.String |
randomSeedTipText()
Returns the tip text for this property |
java.lang.String |
sampleSizeTipText()
Returns the tip text for this property |
void |
setDebug(boolean debug)
sets whether or not debugging output shouild be printed |
void |
setOptions(java.lang.String[] options)
Sets the OptionHandler's options using the given list. |
void |
setRandomSeed(long randomseed)
Set the seed for the random number generator |
void |
setSampleSize(int samplesize)
sets number of samples |
java.lang.String |
toString()
Returns a string representing the best LinearRegression classifier found. |
| Methods inherited from class weka.classifiers.Classifier |
|---|
debugTipText, distributionForInstance, forName, makeCopies, makeCopy |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LeastMedSq()
| Method Detail |
|---|
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface TechnicalInformationHandlerpublic Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class ClassifierCapabilities
public void buildClassifier(Instances data)
throws java.lang.Exception
buildClassifier in class Classifierdata - training data
java.lang.Exception - if an error occurs
public double classifyInstance(Instance instance)
throws java.lang.Exception
classifyInstance in class Classifierinstance - instance to be classified
java.lang.Exception - if an error occurspublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String sampleSizeTipText()
public void setSampleSize(int samplesize)
samplesize - valuepublic int getSampleSize()
public java.lang.String randomSeedTipText()
public void setRandomSeed(long randomseed)
randomseed - the seedpublic long getRandomSeed()
public void setDebug(boolean debug)
setDebug in class Classifierdebug - true if debugging output selectedpublic boolean getDebug()
getDebug in class Classifierpublic java.util.Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class Classifier
public void setOptions(java.lang.String[] options)
throws java.lang.Exception
-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 in interface OptionHandlersetOptions in class Classifieroptions - the list of options as an array of strings
java.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class Classifier
public static int combinations(int n,
int r)
throws java.lang.Exception
n - r -
java.lang.Exception - if r is greater than npublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Classifierpublic static void main(java.lang.String[] argv)
argv - options
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||