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.Instancesm_dataprotected intm_maxprotected weka.classifiers.trees.Node[]m_nodeprotected intm_numIterationsThe number of iterations.protected intm_numTrialsprotected doublem_ridge
-
Constructor Summary
Constructors Constructor Description RandomModelTrees()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildClassifier(weka.core.Instances data)doubleclassifyInstance(weka.core.Instance instance)Calculates the class membership probabilities for the given test instance.weka.core.CapabilitiesgetCapabilities()Returns default capabilities of the classifier.Comparator<weka.core.Instance>[]getComparators(int k)intgetMax()intgetNumIterations()Gets the number of iterations.String[]getOptions()Gets the current settings of the Classifier.StringgetRevision()doublegetRidge()intgetTrials()StringglobalInfo()Returns a string describing classifier.EnumerationlistOptions()Returns an enumeration describing the available options.static voidmain(String[] argv)Main method for testing this class.StringmaxTipText()Returns the tip text for this property.StringnumIterationsTipText()Returns the tip text for this property.StringridgeTipText()Returns the tip text for this property.voidsetMax(int n)voidsetNumIterations(int numIterations)Sets the number of iterations.voidsetOptions(String[] options)Parses a given list of options.voidsetRidge(double c)voidsetTrials(int n)StringtoString()StringtoStringOLD()Returns description of the bagged classifier.StringtrialsTipText()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:
listOptionsin interfaceweka.core.OptionHandler- Overrides:
listOptionsin 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:
setOptionsin interfaceweka.core.OptionHandler- Overrides:
setOptionsin 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:
getOptionsin interfaceweka.core.OptionHandler- Overrides:
getOptionsin 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:
getCapabilitiesin interfaceweka.core.CapabilitiesHandler- Specified by:
getCapabilitiesin interfaceweka.classifiers.Classifier- Overrides:
getCapabilitiesin classweka.classifiers.AbstractClassifier- Returns:
- the capabilities of this classifier
-
buildClassifier
public void buildClassifier(weka.core.Instances data) throws Exception- Specified by:
buildClassifierin 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 ExceptionCalculates the class membership probabilities for the given test instance.- Specified by:
classifyInstancein interfaceweka.classifiers.Classifier- Overrides:
classifyInstancein 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:
getRevisionin interfaceweka.core.RevisionHandler- Overrides:
getRevisionin classweka.classifiers.AbstractClassifier
-
main
public static void main(String[] argv)
Main method for testing this class.- Parameters:
argv- the options
-
-