Type of model to be used. (l: linear regression,
r: regression tree, m: model tree) (default: m)
-U
Use unsmoothed tree.
-F factor
Set pruning factor (default: 2).
-V <0|1|2>
Verbosity (default: 0).
- Author:
- Yong Wang (yongwang@cs.waikato.ac.nz)
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MODEL_LINEAR_REGRESSION
public static final int MODEL_LINEAR_REGRESSION
MODEL_REGRESSION_TREE
public static final int MODEL_REGRESSION_TREE
MODEL_MODEL_TREE
public static final int MODEL_MODEL_TREE
TAGS_MODEL_TYPES
public static final Tag[] TAGS_MODEL_TYPES
M5Prime
public M5Prime()
buildClassifier
public final void buildClassifier(Instances inst)
throws java.lang.Exception
- Construct a model tree by training instances
- Overrides:
buildClassifier
in class Classifier
- Parameters:
inst
- training instancesoptions
- information for constructing the model tree,
mostly from command line options- Returns:
- the root of the model tree
- Throws:
java.lang.Exception
- if the classifier can't be built
classifyInstance
public double classifyInstance(Instance ins)
throws java.lang.Exception
- Classifies the given test instance.
- Overrides:
classifyInstance
in class Classifier
- Parameters:
instance
- the instance to be classified- Returns:
- the predicted class for the instance
- Throws:
java.lang.Exception
- if the instance can't be classified
listOptions
public java.util.Enumeration listOptions()
- Returns an enumeration describing the available options.
Valid options are:
-O
Type of model to be used. (l: linear regression,
r: regression tree, m: model tree) (default: m)
-U
Use unsmoothed tree.
-F factor
Set pruning factor (default: 2).
-V <0|1|2>
Verbosity (default: 0).
- Specified by:
listOptions
in interface OptionHandler
- Returns:
- an enumeration of all the available options
setOptions
public void setOptions(java.lang.String[] options)
throws java.lang.Exception
- Parses a given list of options.
- Specified by:
setOptions
in interface OptionHandler
- Parameters:
options
- the list of options as an array of strings- Throws:
java.lang.Exception
- if an option is not supported
getOptions
public java.lang.String[] getOptions()
- Gets the current settings of the Classifier.
- Specified by:
getOptions
in interface OptionHandler
- Returns:
- an array of strings suitable for passing to setOptions
toString
public final java.lang.String toString()
- Converts the output of the training process into a string
- Overrides:
toString
in class java.lang.Object
- Returns:
- the converted string
measureNumLinearModels
public double measureNumLinearModels()
- return the number of linear models
- Returns:
- the number of linear models
measureNumLeaves
public double measureNumLeaves()
- return the number of leaves in the tree
- Returns:
- the number leaves in the tree (same as # linear models &
# rules)
measureNumRules
public double measureNumRules()
- return the number of rules
- Returns:
- the number of rules (same as # linear models &
# leaves in the tree)
enumerateMeasures
public java.util.Enumeration enumerateMeasures()
- Returns an enumeration of the additional measure names
- Specified by:
enumerateMeasures
in interface AdditionalMeasureProducer
- Returns:
- an enumeration of the measure names
getMeasure
public double getMeasure(java.lang.String additionalMeasureName)
- Returns the value of the named measure
- Specified by:
getMeasure
in interface AdditionalMeasureProducer
- Parameters:
measureName
- the name of the measure to query for its value- Returns:
- the value of the named measure
- Throws:
java.lang.IllegalArgumentException
- if the named measure is not supported
getUseUnsmoothed
public boolean getUseUnsmoothed()
- Get the value of UseUnsmoothed.
- Returns:
- Value of UseUnsmoothed.
setUseUnsmoothed
public void setUseUnsmoothed(boolean v)
- Set the value of UseUnsmoothed.
- Parameters:
v
- Value to assign to UseUnsmoothed.
getPruningFactor
public double getPruningFactor()
- Get the value of PruningFactor.
- Returns:
- Value of PruningFactor.
setPruningFactor
public void setPruningFactor(double v)
- Set the value of PruningFactor.
- Parameters:
v
- Value to assign to PruningFactor.
getModelType
public SelectedTag getModelType()
- Get the value of Model.
- Returns:
- Value of Model.
setModelType
public void setModelType(SelectedTag newMethod)
- Set the value of Model.
- Parameters:
v
- Value to assign to Model.
getVerbosity
public int getVerbosity()
- Get the value of Verbosity.
- Returns:
- Value of Verbosity.
setVerbosity
public void setVerbosity(int v)
- Set the value of Verbosity.
- Parameters:
v
- Value to assign to Verbosity.
main
public static void main(java.lang.String[] argv)
- Main method for M5' algorithm
- Parameters:
argv
- command line arguments