|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.AbstractClassifier
weka.classifiers.SingleClassifierEnhancer
weka.classifiers.meta.AbstainLeastMedianSq
public class AbstainLeastMedianSq
Finds the base classifier with the best least median squared error.
Valid options are:-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.rules.ZeroR)
Options specific to classifier weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the console
-S <sint> Number of regressions (default: 10)
-P <int> Percent sample size (default: 60)
-E <int> Percent Error at (default: 50)
-G <seed> Set the seed used to generate samples (default: 0)
| Field Summary | |
|---|---|
protected weka.classifiers.Classifier |
m_bestClassifier
|
protected double |
m_bestMedian
|
protected weka.classifiers.Classifier[] |
m_cs
|
protected weka.classifiers.Classifier |
m_currentClassifier
|
protected weka.core.Instances |
m_Data
|
protected boolean |
m_debug
|
protected int |
m_errPct
|
protected int |
m_instancepct
|
protected double |
m_max
|
protected double |
m_min
|
protected int |
m_numreg
|
protected boolean |
m_ok
|
protected Random |
m_random
|
protected long |
m_randomseed
|
protected double[] |
m_Residuals
|
protected double |
m_Ridge
|
protected double |
m_scalefactor
|
protected double |
m_SSR
|
protected weka.core.Instances |
m_SubSample
|
protected double |
m_variance
|
protected double[] |
m_weight
|
| Fields inherited from class weka.classifiers.SingleClassifierEnhancer |
|---|
m_Classifier |
| Fields inherited from class weka.classifiers.AbstractClassifier |
|---|
m_Debug |
| Constructor Summary | |
|---|---|
AbstainLeastMedianSq()
|
|
| Method Summary | |
|---|---|
void |
buildClassifier(weka.core.Instances data)
Builds the classifier. |
double |
classifyInstance(weka.core.Instance inst)
Returns the prediction. |
String |
errorTipText()
|
protected void |
findBestRegression()
Finds the best regression generated from m_samples random samples from the training data. |
protected void |
findResiduals()
Finds residuals (squared) for the current regression. |
protected void |
genRegression(Random r)
Generates a LinearRegression classifier from the current m_SubSample. |
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the base classifier. |
boolean |
getDebug()
Returns whether or not debugging output shouild be printed |
int |
getError()
|
protected void |
getErrorAtPct(int pct)
finds the median residual squared for the current regression. |
int |
getNumRegressions()
gets number of samples |
String[] |
getOptions()
Gets the current option settings for the OptionHandler. |
int |
getPct()
|
long |
getRandomSeed()
get the seed for the random number generator |
String |
getRevision()
|
double |
getVariance()
|
String |
globalInfo()
Returns a string describing classifier. |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(String[] argv)
Main method for running this class. |
String |
numRegressionsTipText()
Returns the tip text for this property |
String |
pctTipText()
|
String |
randomSeedTipText()
Returns the tip text for this property |
protected void |
selectSubSample(weka.core.Instances data,
Random r)
Produces a random sample from m_Data in m_SubSample. |
void |
setDebug(boolean debug)
sets whether or not debugging output shouild be printed |
void |
setError(int pct)
|
void |
setNumRegressions(int samplesize)
sets number of samples |
void |
setOptions(String[] options)
Sets the OptionHandler's options using the given list. |
void |
setPct(int pct)
|
void |
setRandomSeed(long randomseed)
Set the seed for the random number generator |
void |
setVariance(double var)
|
String |
toString()
Returns description of classifier. |
String |
varianceTipText()
|
| Methods inherited from class weka.classifiers.SingleClassifierEnhancer |
|---|
classifierTipText, defaultClassifierString, getClassifier, getClassifierSpec, setClassifier |
| Methods inherited from class weka.classifiers.AbstractClassifier |
|---|
debugTipText, distributionForInstance, forName, makeCopies, makeCopy, runClassifier |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double[] m_Residuals
protected double[] m_weight
protected double m_SSR
protected double m_scalefactor
protected double m_bestMedian
protected double m_Ridge
protected weka.classifiers.Classifier m_currentClassifier
protected weka.classifiers.Classifier m_bestClassifier
protected weka.core.Instances m_Data
protected weka.core.Instances m_SubSample
protected int m_numreg
protected int m_instancepct
protected int m_errPct
protected boolean m_debug
protected Random m_random
protected long m_randomseed
protected double m_variance
protected boolean m_ok
protected double m_min
protected double m_max
protected weka.classifiers.Classifier[] m_cs
| Constructor Detail |
|---|
public AbstainLeastMedianSq()
| Method Detail |
|---|
public String globalInfo()
public Enumeration listOptions()
listOptions in interface weka.core.OptionHandlerlistOptions in class weka.classifiers.SingleClassifierEnhancer
public void setOptions(String[] options)
throws Exception
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.rules.ZeroR)
Options specific to classifier weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the console
-S <sint> Number of regressions (default: 10)
-P <int> Percent sample size (default: 60)
-E <int> Percent Error at (default: 50)
-G <seed> Set the seed used to generate samples (default: 0)
setOptions in interface weka.core.OptionHandlersetOptions in class weka.classifiers.SingleClassifierEnhanceroptions - the list of options as an array of strings
Exception - if an option is not supportedpublic String[] getOptions()
getOptions in interface weka.core.OptionHandlergetOptions in class weka.classifiers.SingleClassifierEnhancer
protected void findResiduals()
throws Exception
Exception - if an error occurs
protected void getErrorAtPct(int pct)
throws Exception
Exception - if an error occurs
protected void findBestRegression()
throws Exception
Exception - if an error occurs
protected void selectSubSample(weka.core.Instances data,
Random r)
throws Exception
data - data from which to take sample
Exception - if an error occurs
protected void genRegression(Random r)
throws Exception
Exception - if an error occurspublic weka.core.Capabilities getCapabilities()
getCapabilities in interface weka.classifiers.ClassifiergetCapabilities in interface weka.core.CapabilitiesHandlergetCapabilities in class weka.classifiers.SingleClassifierEnhancer
public void buildClassifier(weka.core.Instances data)
throws Exception
buildClassifier in interface weka.classifiers.Classifierdata - the training data
Exception - if something goes wrong
public double classifyInstance(weka.core.Instance inst)
throws Exception
classifyInstance in interface weka.classifiers.ClassifierclassifyInstance in class weka.classifiers.AbstractClassifierExceptionpublic String toString()
toString in class Objectpublic String getRevision()
getRevision in interface weka.core.RevisionHandlergetRevision in class weka.classifiers.AbstractClassifierpublic String numRegressionsTipText()
public void setVariance(double var)
public double getVariance()
public String varianceTipText()
public void setPct(int pct)
public int getPct()
public String pctTipText()
public void setError(int pct)
public int getError()
public String errorTipText()
public void setNumRegressions(int samplesize)
samplesize - valuepublic int getNumRegressions()
public String randomSeedTipText()
public void setRandomSeed(long randomseed)
randomseed - the seedpublic long getRandomSeed()
public void setDebug(boolean debug)
setDebug in class weka.classifiers.AbstractClassifierdebug - true if debugging output selectedpublic boolean getDebug()
getDebug in class weka.classifiers.AbstractClassifierpublic static void main(String[] argv)
argv - the options
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||