|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--weka.classifiers.functions.LeastMedSq
Implements a least median sqaured linear regression utilising the existing weka LinearRegression class to form predictions. The basis of the algorithm is Robust regression and outlier detection Peter J. Rousseeuw, Annick M. Leroy. c1987
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 |
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 |
int |
getSampleSize()
gets number of samples |
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 |
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 void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class Classifier
data
- training data
java.lang.Exception
- if an error occurspublic double classifyInstance(Instance instance) throws java.lang.Exception
classifyInstance
in class Classifier
instance
- instance to be classified
java.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
setOptions
in interface OptionHandler
setOptions
in class Classifier
options
- 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 OptionHandler
getOptions
in class Classifier
public static int combinations(int n, int r) throws java.lang.Exception
n
-
java.lang.Exception
- if r is greater than npublic 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 |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London