public class AdditiveRegression extends IteratedSingleClassifierEnhancer implements OptionHandler, AdditionalMeasureProducer, WeightedInstancesHandler, TechnicalInformationHandler
@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
Modifier and Type | Field and Description |
---|---|
protected int |
m_NumIterationsPerformed
The number of successfully generated base classifiers.
|
protected double |
m_shrinkage
Shrinkage (Learning rate).
|
protected boolean |
m_SuitableData
whether we have suitable data or nor (if not, ZeroR model is used)
|
protected ZeroR |
m_zeroR
The model for the mean
|
m_Classifiers, m_NumIterations
m_Classifier
m_Debug
Constructor and Description |
---|
AdditiveRegression()
Default constructor specifying DecisionStump as the classifier
|
AdditiveRegression(Classifier classifier)
Constructor which takes base classifier as argument.
|
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances data)
Build the classifier on the supplied data
|
double |
classifyInstance(Instance inst)
Classify an instance.
|
protected String |
defaultClassifierString()
String describing default classifier.
|
Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
double |
getMeasure(String additionalMeasureName)
Returns the value of the named measure
|
String[] |
getOptions()
Gets the current settings of the Classifier.
|
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.
|
String |
globalInfo()
Returns a string describing this attribute evaluator
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] argv)
Main method for testing this class.
|
double |
measureNumIterations()
return the number of iterations (base classifiers) completed
|
void |
setOptions(String[] options)
Parses a given list of options.
|
void |
setShrinkage(double l)
Set the shrinkage parameter
|
String |
shrinkageTipText()
Returns the tip text for this property
|
String |
toString()
Returns textual description of the classifier.
|
getNumIterations, numIterationsTipText, setNumIterations
classifierTipText, getClassifier, getClassifierSpec, setClassifier
debugTipText, distributionForInstance, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug
protected double m_shrinkage
protected int m_NumIterationsPerformed
protected ZeroR m_zeroR
protected boolean m_SuitableData
public AdditiveRegression()
public AdditiveRegression(Classifier classifier)
classifier
- the base classifier to usepublic String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
protected String defaultClassifierString()
defaultClassifierString
in class SingleClassifierEnhancer
public Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class IteratedSingleClassifierEnhancer
public void setOptions(String[] options) throws 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 stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class IteratedSingleClassifierEnhancer
public 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 Exception
buildClassifier
in class IteratedSingleClassifierEnhancer
data
- the training dataException
- if the classifier could not be built successfullypublic double classifyInstance(Instance inst) throws Exception
classifyInstance
in class Classifier
inst
- the instance to predictException
- if an error occurspublic Enumeration enumerateMeasures()
enumerateMeasures
in interface AdditionalMeasureProducer
public double getMeasure(String additionalMeasureName)
getMeasure
in interface AdditionalMeasureProducer
additionalMeasureName
- the name of the measure to query for its valueIllegalArgumentException
- if the named measure is not supportedpublic double measureNumIterations()
public String toString()
public String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Classifier
public static void main(String[] argv)
argv
- should contain the following arguments:
-t training file [-T test file] [-c class index]Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.