|
||||||||||
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
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 |
boolean |
getIsRandom()
Returns whether or not samples are selected randomly |
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.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 |
void |
setDebug(boolean debug)
sets whether or not debugging output shouild be printed |
void |
setIsRandom(boolean israndom)
Sets whether sample selection is random |
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 |
forName, makeCopies |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LeastMedSq()
Method Detail |
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()
public void setSampleSize(int samplesize)
samplesize
- valuepublic int getSampleSize()
public void setIsRandom(boolean israndom)
israndom
- true if sample selection is randompublic boolean getIsRandom()
public void setRandomSeed(long randomseed)
randomseed
- the seedpublic long getRandomSeed()
public void setDebug(boolean debug)
debug
- true if debugging output selectedpublic boolean getDebug()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface OptionHandler
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
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 |