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, makeCopy
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Classifier
Capabilities
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class Classifier
data
- training datajava.lang.Exception
- if an error occurspublic double classifyInstance(Instance instance) throws java.lang.Exception
classifyInstance
in class Classifier
instance
- instance to be classifiedjava.lang.Exception
- if an error occurspublic java.lang.String toString()
toString
in class java.lang.Object
public 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 Classifier
debug
- true if debugging output selectedpublic boolean getDebug()
getDebug
in class Classifier
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
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 OptionHandler
setOptions
in class Classifier
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
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 RevisionHandler
getRevision
in class Classifier
public static void main(java.lang.String[] argv)
argv
- options