|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.SingleClassifierEnhancer
weka.classifiers.IteratedSingleClassifierEnhancer
weka.classifiers.meta.AdditiveRegression
public class AdditiveRegression
Meta classifier that enhances the performance of a regression base classifier. Each iteration fits a model to the residuals left by the classifier on the previous iteration. Prediction is accomplished by adding the predictions of each classifier. Reducing the shrinkage (learning rate) parameter helps prevent overfitting and has a smoothing effect but increases the learning time.
For more information see:
J.H. Friedman (1999). Stochastic Gradient Boosting.
@techreport{Friedman1999, author = {J.H. Friedman}, institution = {Stanford University}, title = {Stochastic Gradient Boosting}, year = {1999}, PS = {http://www-stat.stanford.edu/\~jhf/ftp/stobst.ps} }Valid options are:
-S Specify shrinkage rate. (default = 1.0, ie. no shrinkage)
-I <num> Number of iterations. (default 10)
-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.trees.DecisionStump)
Options specific to classifier weka.classifiers.trees.DecisionStump:
-D If set, classifier is run in debug mode and may output additional info to the console
Constructor Summary | |
---|---|
AdditiveRegression()
Default constructor specifying DecisionStump as the classifier |
|
AdditiveRegression(Classifier classifier)
Constructor which takes base classifier as argument. |
Method Summary | |
---|---|
void |
buildClassifier(Instances data)
Build the classifier on the supplied data |
double |
classifyInstance(Instance inst)
Classify an instance. |
java.util.Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
java.lang.String |
getRevision()
Returns the revision string. |
double |
getShrinkage()
Get the shrinkage rate. |
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 attribute evaluator |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
double |
measureNumIterations()
return the number of iterations (base classifiers) completed |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setShrinkage(double l)
Set the shrinkage parameter |
java.lang.String |
shrinkageTipText()
Returns the tip text for this property |
java.lang.String |
toString()
Returns textual description of the classifier. |
Methods inherited from class weka.classifiers.IteratedSingleClassifierEnhancer |
---|
getNumIterations, numIterationsTipText, setNumIterations |
Methods inherited from class weka.classifiers.SingleClassifierEnhancer |
---|
classifierTipText, getClassifier, setClassifier |
Methods inherited from class weka.classifiers.Classifier |
---|
debugTipText, distributionForInstance, forName, getDebug, makeCopies, makeCopy, setDebug |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AdditiveRegression()
public AdditiveRegression(Classifier classifier)
classifier
- the base classifier to useMethod Detail |
---|
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class IteratedSingleClassifierEnhancer
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-S Specify shrinkage rate. (default = 1.0, ie. no shrinkage)
-I <num> Number of iterations. (default 10)
-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.trees.DecisionStump)
Options specific to classifier weka.classifiers.trees.DecisionStump:
-D If set, classifier is run in debug mode and may output additional info to the console
setOptions
in interface OptionHandler
setOptions
in class IteratedSingleClassifierEnhancer
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 IteratedSingleClassifierEnhancer
public java.lang.String shrinkageTipText()
public void setShrinkage(double l)
l
- the shrinkage rate.public double getShrinkage()
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class SingleClassifierEnhancer
Capabilities
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class IteratedSingleClassifierEnhancer
data
- the training data
java.lang.Exception
- if the classifier could not be built successfullypublic double classifyInstance(Instance inst) throws java.lang.Exception
classifyInstance
in class Classifier
inst
- the instance to predict
java.lang.Exception
- if an error occurspublic java.util.Enumeration enumerateMeasures()
enumerateMeasures
in interface AdditionalMeasureProducer
public double getMeasure(java.lang.String additionalMeasureName)
getMeasure
in interface AdditionalMeasureProducer
additionalMeasureName
- the name of the measure to query for its value
java.lang.IllegalArgumentException
- if the named measure is not supportedpublic double measureNumIterations()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
public static void main(java.lang.String[] argv)
argv
- should contain the following arguments:
-t training file [-T test file] [-c class index]
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |