public abstract class M5Base extends AbstractClassifier implements AdditionalMeasureProducer, TechnicalInformationHandler
The original algorithm M5 was invented by Quinlan:
Quinlan J. R. (1992). Learning with continuous classes. Proceedings of the
Australian Joint Conference on Artificial Intelligence. 343--348. World
Scientific, Singapore.
-U
Use unsmoothed predictions.
-R
Build regression tree/rule rather than model tree/rule
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
Constructor and Description |
---|
M5Base()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances data)
Generates the classifier.
|
java.lang.String |
buildRegressionTreeTipText()
Returns the tip text for this property
|
double |
classifyInstance(Instance inst)
Calculates a prediction for an instance using a set of rules or an M5 model
tree
|
java.util.Enumeration<java.lang.String> |
enumerateMeasures()
Returns an enumeration of the additional measure names
|
java.lang.String |
generateRulesTipText()
Returns the tip text for this property
|
boolean |
getBuildRegressionTree()
Get the value of regressionTree.
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier, i.e., of LinearRegression.
|
RuleNode |
getM5RootNode() |
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure
|
double |
getMinNumInstances()
Get the minimum number of instances to allow at a leaf node
|
java.lang.String[] |
getOptions()
Gets the current settings of the classifier.
|
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 |
getUnpruned()
Get whether unpruned tree/rules are being generated
|
boolean |
getUseUnsmoothed()
Get whether or not smoothing is being used
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options
|
double |
measureNumRules()
return the number of rules
|
java.lang.String |
minNumInstancesTipText()
Returns the tip text for this property
|
void |
setBuildRegressionTree(boolean newregressionTree)
Set the value of regressionTree.
|
void |
setMinNumInstances(double minNum)
Set the minimum number of instances to allow at a leaf node
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setUnpruned(boolean unpruned)
Use unpruned tree/rules
|
void |
setUseUnsmoothed(boolean s)
Use unsmoothed predictions
|
java.lang.String |
toString()
Returns a description of the classifier
|
java.lang.String |
unprunedTipText()
Returns the tip text for this property
|
java.lang.String |
useUnsmoothedTipText()
Returns the tip text for this property
|
batchSizeTipText, debugTipText, distributionForInstance, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, getRevision, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
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
-U
Use unsmoothed predictions.
-R
Build a regression tree rather than a model tree.
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 java.lang.String unprunedTipText()
public void setUnpruned(boolean unpruned)
unpruned
- true if unpruned tree/rules are to be generatedpublic boolean getUnpruned()
public java.lang.String generateRulesTipText()
public java.lang.String useUnsmoothedTipText()
public void setUseUnsmoothed(boolean s)
s
- true if unsmoothed predictions are to be usedpublic boolean getUseUnsmoothed()
public java.lang.String buildRegressionTreeTipText()
public boolean getBuildRegressionTree()
public void setBuildRegressionTree(boolean newregressionTree)
newregressionTree
- Value to assign to regressionTree.public java.lang.String minNumInstancesTipText()
public void setMinNumInstances(double minNum)
minNum
- the minimum number of instancespublic double getMinNumInstances()
double
valuepublic 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
- set of instances serving as training datajava.lang.Exception
- if the classifier has not been generated successfullypublic double classifyInstance(Instance inst) throws java.lang.Exception
classifyInstance
in interface Classifier
classifyInstance
in class AbstractClassifier
inst
- the instance whos class value is to be predictedjava.lang.Exception
- if a prediction can't be made.public java.lang.String toString()
toString
in class java.lang.Object
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.Exception
- if the named measure is not supportedpublic double measureNumRules()
public RuleNode getM5RootNode()