Package weka.classifiers.trees
Class RandomModelTrees
- java.lang.Object
-
- weka.classifiers.AbstractClassifier
-
- weka.classifiers.RandomizableClassifier
-
- weka.classifiers.trees.RandomModelTrees
-
- All Implemented Interfaces:
Serializable
,Cloneable
,weka.classifiers.Classifier
,weka.core.BatchPredictor
,weka.core.CapabilitiesHandler
,weka.core.CapabilitiesIgnorer
,weka.core.CommandlineRunnable
,weka.core.OptionHandler
,weka.core.Randomizable
,weka.core.RevisionHandler
,weka.core.WeightedInstancesHandler
public class RandomModelTrees extends weka.classifiers.RandomizableClassifier implements weka.core.OptionHandler, weka.core.WeightedInstancesHandler
- Version:
- $Revision$
- Author:
- Bernhard Pfahringer ([email protected])
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected weka.core.Instances
m_data
protected int
m_max
protected weka.classifiers.trees.Node[]
m_node
protected int
m_numIterations
The number of iterations.protected int
m_numTrials
protected double
m_ridge
-
Constructor Summary
Constructors Constructor Description RandomModelTrees()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
buildClassifier(weka.core.Instances data)
double
classifyInstance(weka.core.Instance instance)
Calculates the class membership probabilities for the given test instance.weka.core.Capabilities
getCapabilities()
Returns default capabilities of the classifier.Comparator<weka.core.Instance>[]
getComparators(int k)
int
getMax()
int
getNumIterations()
Gets the number of iterations.String[]
getOptions()
Gets the current settings of the Classifier.String
getRevision()
double
getRidge()
int
getTrials()
String
globalInfo()
Returns a string describing classifier.Enumeration
listOptions()
Returns an enumeration describing the available options.static void
main(String[] argv)
Main method for testing this class.String
maxTipText()
Returns the tip text for this property.String
numIterationsTipText()
Returns the tip text for this property.String
ridgeTipText()
Returns the tip text for this property.void
setMax(int n)
void
setNumIterations(int numIterations)
Sets the number of iterations.void
setOptions(String[] options)
Parses a given list of options.void
setRidge(double c)
void
setTrials(int n)
String
toString()
String
toStringOLD()
Returns description of the bagged classifier.String
trialsTipText()
Returns the tip text for this property.-
Methods inherited from class weka.classifiers.AbstractClassifier
batchSizeTipText, debugTipText, distributionForInstance, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing classifier.- Returns:
- a description suitable for displaying in the explorer/experimenter gui
-
listOptions
public Enumeration listOptions()
Returns an enumeration describing the available options.- Specified by:
listOptions
in interfaceweka.core.OptionHandler
- Overrides:
listOptions
in classweka.classifiers.RandomizableClassifier
- Returns:
- an enumeration of all the available options.
-
setOptions
public void setOptions(String[] options) throws Exception
Parses a given list of options.- Specified by:
setOptions
in interfaceweka.core.OptionHandler
- Overrides:
setOptions
in classweka.classifiers.RandomizableClassifier
- Parameters:
options
- the list of options as an array of strings- Throws:
Exception
- if an option is not supported
-
getOptions
public String[] getOptions()
Gets the current settings of the Classifier.- Specified by:
getOptions
in interfaceweka.core.OptionHandler
- Overrides:
getOptions
in classweka.classifiers.RandomizableClassifier
- Returns:
- an array of strings suitable for passing to setOptions
-
getTrials
public int getTrials()
-
setTrials
public void setTrials(int n)
-
trialsTipText
public String trialsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getRidge
public double getRidge()
-
setRidge
public void setRidge(double c)
-
ridgeTipText
public String ridgeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setNumIterations
public void setNumIterations(int numIterations)
Sets the number of iterations.
-
getNumIterations
public int getNumIterations()
Gets the number of iterations.- Returns:
- the maximum number of iterations
-
numIterationsTipText
public String numIterationsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getMax
public int getMax()
-
setMax
public void setMax(int n)
-
maxTipText
public String maxTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getCapabilities
public weka.core.Capabilities getCapabilities()
Returns default capabilities of the classifier.- Specified by:
getCapabilities
in interfaceweka.core.CapabilitiesHandler
- Specified by:
getCapabilities
in interfaceweka.classifiers.Classifier
- Overrides:
getCapabilities
in classweka.classifiers.AbstractClassifier
- Returns:
- the capabilities of this classifier
-
buildClassifier
public void buildClassifier(weka.core.Instances data) throws Exception
- Specified by:
buildClassifier
in interfaceweka.classifiers.Classifier
- Parameters:
data
- the training data to be used for generating the- Throws:
Exception
- if the classifier could not be built successfully
-
getComparators
public Comparator<weka.core.Instance>[] getComparators(int k)
-
classifyInstance
public double classifyInstance(weka.core.Instance instance) throws Exception
Calculates the class membership probabilities for the given test instance.- Specified by:
classifyInstance
in interfaceweka.classifiers.Classifier
- Overrides:
classifyInstance
in classweka.classifiers.AbstractClassifier
- Parameters:
instance
- the instance to be classified- Returns:
- preedicted class probability distribution
- Throws:
Exception
- if distribution can't be computed successfully
-
toStringOLD
public String toStringOLD()
Returns description of the bagged classifier.- Returns:
- description of the bagged classifier as a string
-
getRevision
public String getRevision()
- Specified by:
getRevision
in interfaceweka.core.RevisionHandler
- Overrides:
getRevision
in classweka.classifiers.AbstractClassifier
-
main
public static void main(String[] argv)
Main method for testing this class.- Parameters:
argv
- the options
-
-