public class LMT extends AbstractClassifier implements OptionHandler, AdditionalMeasureProducer, Drawable, TechnicalInformationHandler
@article{Landwehr2005, author = {Niels Landwehr and Mark Hall and Eibe Frank}, journal = {Machine Learning}, number = {1-2}, pages = {161-205}, title = {Logistic Model Trees}, volume = {95}, year = {2005} } @inproceedings{Sumner2005, author = {Marc Sumner and Eibe Frank and Mark Hall}, booktitle = {9th European Conference on Principles and Practice of Knowledge Discovery in Databases}, pages = {675-683}, publisher = {Springer}, title = {Speeding up Logistic Model Tree Induction}, year = {2005} }Valid options are:
-B Binary splits (convert nominal attributes to binary ones)
-R Split on residuals instead of class values
-C Use cross-validation for boosting at all nodes (i.e., disable heuristic)
-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)
-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.
-doNotMakeSplitPointActualValue Do not make split point actual value.
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
BayesNet, Newick, NOT_DRAWABLE, TREE
Constructor and Description |
---|
LMT()
Creates an instance of LMT with standard options
|
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances data)
Builds the classifier.
|
double |
classifyInstance(Instance instance)
Classifies an instance.
|
java.lang.String |
convertNominalTipText()
Returns the tip text for this property
|
double[] |
distributionForInstance(Instance instance)
Returns class probabilities for an instance.
|
java.lang.String |
doNotMakeSplitPointActualValueTipText()
Returns the tip text for this property
|
java.util.Enumeration<java.lang.String> |
enumerateMeasures()
Returns an enumeration of the additional measure names
|
java.lang.String |
errorOnProbabilitiesTipText()
Returns the tip text for this property
|
java.lang.String |
fastRegressionTipText()
Returns the tip text for this property
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
boolean |
getConvertNominal()
Get the value of convertNominal.
|
boolean |
getDoNotMakeSplitPointActualValue()
Gets the value of doNotMakeSplitPointActualValue.
|
boolean |
getErrorOnProbabilities()
Get the value of errorOnProbabilities.
|
boolean |
getFastRegression()
Get the value of fastRegression.
|
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure
|
int |
getMinNumInstances()
Get the value of minNumInstances.
|
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.
|
boolean |
getSplitOnResiduals()
Get the value of splitOnResiduals.
|
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<Option> |
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 |
numBoostingIterationsTipText()
Returns the tip text for this property
|
java.lang.String |
numDecimalPlacesTipText()
Returns the tip text for this property
|
void |
setConvertNominal(boolean c)
Set the value of convertNominal.
|
void |
setDoNotMakeSplitPointActualValue(boolean m_doNotMakeSplitPointActualValue)
Sets the value of doNotMakeSplitPointActualValue.
|
void |
setErrorOnProbabilities(boolean c)
Set the value of errorOnProbabilities.
|
void |
setFastRegression(boolean c)
Set the value of fastRegression.
|
void |
setMinNumInstances(int c)
Set the value of minNumInstances.
|
void |
setNumBoostingIterations(int c)
Set the value of numBoostingIterations.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setSplitOnResiduals(boolean c)
Set the value of splitOnResiduals.
|
void |
setUseAIC(boolean c)
Set the value of useAIC.
|
void |
setWeightTrimBeta(double n)
Set the value of weightTrimBeta.
|
java.lang.String |
splitOnResidualsTipText()
Returns the tip text for this property
|
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, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClassifier
Capabilities
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in interface Classifier
data
- the data to train withjava.lang.Exception
- if classifier can't be built successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in interface Classifier
distributionForInstance
in class AbstractClassifier
instance
- the instance to compute the distribution forjava.lang.Exception
- if distribution can't be computed successfullypublic double classifyInstance(Instance instance) throws java.lang.Exception
classifyInstance
in interface Classifier
classifyInstance
in class 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<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class AbstractClassifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-B Binary splits (convert nominal attributes to binary ones)
-R Split on residuals instead of class values
-C Use cross-validation for boosting at all nodes (i.e., disable heuristic)
-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)
-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.
-doNotMakeSplitPointActualValue Do not make split point actual value.
setOptions
in interface OptionHandler
setOptions
in class 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 OptionHandler
getOptions
in class 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 getConvertNominal()
public boolean getSplitOnResiduals()
public boolean getFastRegression()
public boolean getErrorOnProbabilities()
public int getNumBoostingIterations()
public int getMinNumInstances()
public void setConvertNominal(boolean c)
c
- Value to assign to convertNominal.public void setSplitOnResiduals(boolean c)
c
- Value to assign to splitOnResiduals.public void setFastRegression(boolean c)
c
- Value to assign to fastRegression.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()
public java.lang.String graph() throws java.lang.Exception
public int measureTreeSize()
public int measureNumLeaves()
public java.util.Enumeration<java.lang.String> 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 valuejava.lang.IllegalArgumentException
- if the named measure is not supportedpublic java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public java.lang.String convertNominalTipText()
public java.lang.String splitOnResidualsTipText()
public java.lang.String fastRegressionTipText()
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 doNotMakeSplitPointActualValueTipText()
public java.lang.String numDecimalPlacesTipText()
numDecimalPlacesTipText
in class AbstractClassifier
public boolean getDoNotMakeSplitPointActualValue()
public void setDoNotMakeSplitPointActualValue(boolean m_doNotMakeSplitPointActualValue)
m_doNotMakeSplitPointActualValue
- the value to setpublic java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClassifier
public static void main(java.lang.String[] argv)
argv
- the commandline options