public class FT
extends weka.classifiers.AbstractClassifier
implements weka.core.OptionHandler, weka.core.AdditionalMeasureProducer, weka.core.Drawable, weka.core.TechnicalInformationHandler
@article{Gama2004, author = {Joao Gama}, booktitle = {Machine Learning}, number = {3}, pages = {219-250}, title = {Functional Trees}, volume = {55}, year = {2004} } @article{Landwehr2005, author = {Niels Landwehr and Mark Hall and Eibe Frank}, booktitle = {Machine Learning}, number = {1-2}, pages = {161-205}, title = {Logistic Model Trees}, volume = {95}, year = {2005} }Valid options are:
-B Binary splits (convert nominal attributes to binary ones)
-P Use error on probabilities instead of misclassification error for stopping criterion of LogitBoost.
-I <numIterations> Set fixed number of iterations for LogitBoost (instead of using cross-validation)
-F <modelType> Set Funtional Tree type to be generate: 0 for FT, 1 for FTLeaves and 2 for FTInner
-M <numInstances> Set minimum number of instances at which a node can be split (default 15)
-W <beta> Set beta for weight trimming for LogitBoost. Set to 0 (default) for no weight trimming.
-A The AIC is used to choose the best iteration.
Modifier and Type | Field and Description |
---|---|
static int |
MODEL_FT
model types
|
static int |
MODEL_FTInner |
static int |
MODEL_FTLeaves |
static weka.core.Tag[] |
TAGS_MODEL
possible model types.
|
Constructor and Description |
---|
FT()
Creates an instance of FT with standard options
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
binSplitTipText()
Returns the tip text for this property
|
void |
buildClassifier(weka.core.Instances data)
Builds the classifier.
|
double |
classifyInstance(weka.core.Instance instance)
Classifies an instance.
|
double[] |
distributionForInstance(weka.core.Instance instance)
Returns class probabilities for an instance.
|
java.util.Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names
|
java.lang.String |
errorOnProbabilitiesTipText()
Returns the tip text for this property
|
boolean |
getBinSplit()
Get the value of binarySplits.
|
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
boolean |
getErrorOnProbabilities()
Get the value of errorOnProbabilities.
|
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure
|
int |
getMinNumInstances()
Get the value of minNumInstances.
|
weka.core.SelectedTag |
getModelType()
Get the type of functional tree model being used.
|
int |
getNumBoostingIterations()
Get the value of numBoostingIterations.
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
weka.core.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.
|
boolean |
getUseAIC()
Get the value of useAIC.
|
double |
getWeightTrimBeta()
Get the value of weightTrimBeta.
|
java.lang.String |
globalInfo()
Returns a string describing classifier
|
java.lang.String |
graph()
Returns graph describing the tree.
|
int |
graphType()
Returns the type of graph this classifier
represents.
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class
|
int |
measureNumLeaves()
Returns the number of leaves in the tree
|
int |
measureTreeSize()
Returns the size of the tree
|
java.lang.String |
minNumInstancesTipText()
Returns the tip text for this property
|
java.lang.String |
modelTypeTipText()
Returns the tip text for this property
|
java.lang.String |
numBoostingIterationsTipText()
Returns the tip text for this property
|
void |
setBinSplit(boolean c)
Set the value of binarySplits.
|
void |
setErrorOnProbabilities(boolean c)
Set the value of errorOnProbabilities.
|
void |
setMinNumInstances(int c)
Set the value of minNumInstances.
|
void |
setModelType(weka.core.SelectedTag newMethod)
Set the Functional Tree type.
|
void |
setNumBoostingIterations(int c)
Set the value of numBoostingIterations.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setUseAIC(boolean c)
Set the value of useAIC.
|
void |
setWeightTrimBeta(double n)
Set the value of weightTrimBeta.
|
java.lang.String |
toString()
Returns a description of the classifier.
|
java.lang.String |
useAICTipText()
Returns the tip text for this property
|
java.lang.String |
weightTrimBetaTipText()
Returns the tip text for this property
|
batchSizeTipText, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
public static final int MODEL_FT
public static final int MODEL_FTLeaves
public static final int MODEL_FTInner
public static final weka.core.Tag[] TAGS_MODEL
public weka.core.Capabilities getCapabilities()
getCapabilities
in interface weka.classifiers.Classifier
getCapabilities
in interface weka.core.CapabilitiesHandler
getCapabilities
in class weka.classifiers.AbstractClassifier
public void buildClassifier(weka.core.Instances data) throws java.lang.Exception
buildClassifier
in interface weka.classifiers.Classifier
data
- the data to train withjava.lang.Exception
- if classifier can't be built successfullypublic double[] distributionForInstance(weka.core.Instance instance) throws java.lang.Exception
distributionForInstance
in interface weka.classifiers.Classifier
distributionForInstance
in class weka.classifiers.AbstractClassifier
instance
- the instance to compute the distribution forjava.lang.Exception
- if distribution can't be computed successfullypublic double classifyInstance(weka.core.Instance instance) throws java.lang.Exception
classifyInstance
in interface weka.classifiers.Classifier
classifyInstance
in class weka.classifiers.AbstractClassifier
instance
- the instance to classifyjava.lang.Exception
- if instance can't be classified successfullypublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.Enumeration listOptions()
listOptions
in interface weka.core.OptionHandler
listOptions
in class weka.classifiers.AbstractClassifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-B Binary splits (convert nominal attributes to binary ones)
-P Use error on probabilities instead of misclassification error for stopping criterion of LogitBoost.
-I <numIterations> Set fixed number of iterations for LogitBoost (instead of using cross-validation)
-F <modelType> Set Funtional Tree type to be generate: 0 for FT, 1 for FTLeaves and 2 for FTInner
-M <numInstances> Set minimum number of instances at which a node can be split (default 15)
-W <beta> Set beta for weight trimming for LogitBoost. Set to 0 (default) for no weight trimming.
-A The AIC is used to choose the best iteration.
setOptions
in interface weka.core.OptionHandler
setOptions
in class weka.classifiers.AbstractClassifier
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface weka.core.OptionHandler
getOptions
in class weka.classifiers.AbstractClassifier
public double getWeightTrimBeta()
public boolean getUseAIC()
public void setWeightTrimBeta(double n)
public void setUseAIC(boolean c)
c
- Value to assign to useAIC.public boolean getBinSplit()
public boolean getErrorOnProbabilities()
public int getNumBoostingIterations()
public weka.core.SelectedTag getModelType()
public void setModelType(weka.core.SelectedTag newMethod)
newMethod
- Value corresponding to tree type.public int getMinNumInstances()
public void setBinSplit(boolean c)
c
- Value to assign to binarySplits.public void setErrorOnProbabilities(boolean c)
c
- Value to assign to errorOnProbabilities.public void setNumBoostingIterations(int c)
c
- Value to assign to numBoostingIterations.public void setMinNumInstances(int c)
c
- Value to assign to minNumInstances.public int graphType()
graphType
in interface weka.core.Drawable
public java.lang.String graph() throws java.lang.Exception
graph
in interface weka.core.Drawable
java.lang.Exception
- if graph can't be computedpublic int measureTreeSize()
public int measureNumLeaves()
public java.util.Enumeration enumerateMeasures()
enumerateMeasures
in interface weka.core.AdditionalMeasureProducer
public double getMeasure(java.lang.String additionalMeasureName)
getMeasure
in interface weka.core.AdditionalMeasureProducer
additionalMeasureName
- the name of the measure to query for its valuejava.lang.IllegalArgumentException
- if the named measure is not supportedpublic java.lang.String globalInfo()
public weka.core.TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface weka.core.TechnicalInformationHandler
public java.lang.String modelTypeTipText()
public java.lang.String binSplitTipText()
public java.lang.String errorOnProbabilitiesTipText()
public java.lang.String numBoostingIterationsTipText()
public java.lang.String minNumInstancesTipText()
public java.lang.String weightTrimBetaTipText()
public java.lang.String useAICTipText()
public java.lang.String getRevision()
getRevision
in interface weka.core.RevisionHandler
getRevision
in class weka.classifiers.AbstractClassifier
public static void main(java.lang.String[] argv)
argv
- the commandline options