public class LeastMedSq extends Classifier implements OptionHandler, TechnicalInformationHandler
@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 and Description |
|---|
LeastMedSq() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
debugTipText, distributionForInstance, forName, makeCopies, makeCopypublic java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface TechnicalInformationHandlerpublic Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class ClassifierCapabilitiespublic void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier in class Classifierdata - training datajava.lang.Exception - if an error occurspublic double classifyInstance(Instance instance) throws java.lang.Exception
classifyInstance in class Classifierinstance - instance to be classifiedjava.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 Classifierpublic 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 stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class Classifierpublic 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