类 REPTree
java.lang.Object
weka.classifiers.Classifier
weka.classifiers.trees.REPTree
- 所有已实现的接口:
Serializable
,Cloneable
,Sourcable
,AdditionalMeasureProducer
,CapabilitiesHandler
,Drawable
,OptionHandler
,Randomizable
,RevisionHandler
,WeightedInstancesHandler
public class REPTree
extends Classifier
implements OptionHandler, WeightedInstancesHandler, Drawable, AdditionalMeasureProducer, Sourcable, Randomizable
Fast decision tree learner. Builds a decision/regression tree using information gain/variance and prunes it using reduced-error pruning (with backfitting). Only sorts values for numeric attributes once. Missing values are dealt with by splitting the corresponding instances into pieces (i.e. as in C4.5).
Valid options are:
-M <minimum number of instances> Set minimum number of instances per leaf (default 2).
-V <minimum variance for split> Set minimum numeric class variance proportion of train variance for split (default 1e-3).
-N <number of folds> Number of folds for reduced error pruning (default 3).
-S <seed> Seed for random data shuffling (default 1).
-P No pruning.
-L Maximum tree depth (default -1, no maximum)
- 版本:
- $Revision: 10275 $
- 作者:
- Eibe Frank (eibe@cs.waikato.ac.nz)
- 另请参阅:
-
字段概要
从接口继承的字段 weka.core.Drawable
BayesNet, Newick, NOT_DRAWABLE, TREE
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
buildClassifier
(Instances data) Builds classifier.double[]
distributionForInstance
(Instance instance) Computes class distribution of an instance using the tree.Returns an enumeration of the additional measure names.Returns default capabilities of the classifier.int
Get the value of MaxDepth.double
getMeasure
(String additionalMeasureName) Returns the value of the named measure.double
Get the value of MinNum.double
Get the value of MinVarianceProp.boolean
Get the value of NoPruning.int
Get the value of NumFolds.String[]
Gets options from this classifier.Returns the revision string.int
getSeed()
Get the value of Seed.Returns a string describing classifiergraph()
Outputs the decision tree as a graphint
Returns the type of graph this classifier represents.Lists the command-line options for this classifier.static void
Main method for this class.Returns the tip text for this propertyReturns the tip text for this propertyReturns the tip text for this propertyReturns the tip text for this propertyReturns the tip text for this propertyint
numNodes()
Computes size of the tree.Returns the tip text for this propertyvoid
setMaxDepth
(int newMaxDepth) Set the value of MaxDepth.void
setMinNum
(double newMinNum) Set the value of MinNum.void
setMinVarianceProp
(double newMinVarianceProp) Set the value of MinVarianceProp.void
setNoPruning
(boolean newNoPruning) Set the value of NoPruning.void
setNumFolds
(int newNumFolds) Set the value of NumFolds.void
setOptions
(String[] options) Parses a given list of options.void
setSeed
(int newSeed) Set the value of Seed.Returns the tree as if-then statements.toString()
Outputs the decision tree.从类继承的方法 weka.classifiers.Classifier
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug
-
构造器详细资料
-
REPTree
public REPTree()
-
-
方法详细资料
-
globalInfo
Returns a string describing classifier- 返回:
- a description suitable for displaying in the explorer/experimenter gui
-
noPruningTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getNoPruning
public boolean getNoPruning()Get the value of NoPruning.- 返回:
- Value of NoPruning.
-
setNoPruning
public void setNoPruning(boolean newNoPruning) Set the value of NoPruning.- 参数:
newNoPruning
- Value to assign to NoPruning.
-
minNumTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getMinNum
public double getMinNum()Get the value of MinNum.- 返回:
- Value of MinNum.
-
setMinNum
public void setMinNum(double newMinNum) Set the value of MinNum.- 参数:
newMinNum
- Value to assign to MinNum.
-
minVariancePropTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getMinVarianceProp
public double getMinVarianceProp()Get the value of MinVarianceProp.- 返回:
- Value of MinVarianceProp.
-
setMinVarianceProp
public void setMinVarianceProp(double newMinVarianceProp) Set the value of MinVarianceProp.- 参数:
newMinVarianceProp
- Value to assign to MinVarianceProp.
-
seedTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getSeed
public int getSeed()Get the value of Seed.- 指定者:
getSeed
在接口中Randomizable
- 返回:
- Value of Seed.
-
setSeed
public void setSeed(int newSeed) Set the value of Seed.- 指定者:
setSeed
在接口中Randomizable
- 参数:
newSeed
- Value to assign to Seed.
-
numFoldsTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getNumFolds
public int getNumFolds()Get the value of NumFolds.- 返回:
- Value of NumFolds.
-
setNumFolds
public void setNumFolds(int newNumFolds) Set the value of NumFolds.- 参数:
newNumFolds
- Value to assign to NumFolds.
-
maxDepthTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getMaxDepth
public int getMaxDepth()Get the value of MaxDepth.- 返回:
- Value of MaxDepth.
-
setMaxDepth
public void setMaxDepth(int newMaxDepth) Set the value of MaxDepth.- 参数:
newMaxDepth
- Value to assign to MaxDepth.
-
listOptions
Lists the command-line options for this classifier.- 指定者:
listOptions
在接口中OptionHandler
- 覆盖:
listOptions
在类中Classifier
- 返回:
- an enumeration over all commandline options
-
getOptions
Gets options from this classifier.- 指定者:
getOptions
在接口中OptionHandler
- 覆盖:
getOptions
在类中Classifier
- 返回:
- the options for the current setup
-
setOptions
Parses a given list of options. Valid options are:-M <minimum number of instances> Set minimum number of instances per leaf (default 2).
-V <minimum variance for split> Set minimum numeric class variance proportion of train variance for split (default 1e-3).
-N <number of folds> Number of folds for reduced error pruning (default 3).
-S <seed> Seed for random data shuffling (default 1).
-P No pruning.
-L Maximum tree depth (default -1, no maximum)
- 指定者:
setOptions
在接口中OptionHandler
- 覆盖:
setOptions
在类中Classifier
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
numNodes
public int numNodes()Computes size of the tree.- 返回:
- the number of nodes
-
enumerateMeasures
Returns an enumeration of the additional measure names.- 指定者:
enumerateMeasures
在接口中AdditionalMeasureProducer
- 返回:
- an enumeration of the measure names
-
getMeasure
Returns the value of the named measure.- 指定者:
getMeasure
在接口中AdditionalMeasureProducer
- 参数:
additionalMeasureName
- the name of the measure to query for its value- 返回:
- the value of the named measure
- 抛出:
IllegalArgumentException
- if the named measure is not supported
-
getCapabilities
Returns default capabilities of the classifier.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中Classifier
- 返回:
- the capabilities of this classifier
- 另请参阅:
-
buildClassifier
Builds classifier.- 指定者:
buildClassifier
在类中Classifier
- 参数:
data
- the data to train with- 抛出:
Exception
- if building fails
-
distributionForInstance
Computes class distribution of an instance using the tree.- 覆盖:
distributionForInstance
在类中Classifier
- 参数:
instance
- the instance to compute the distribution for- 返回:
- the computed class probabilities
- 抛出:
Exception
- if computation fails
-
toSource
Returns the tree as if-then statements. -
graphType
public int graphType()Returns the type of graph this classifier represents. -
graph
Outputs the decision tree as a graph -
toString
Outputs the decision tree. -
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中Classifier
- 返回:
- the revision
-
main
Main method for this class.- 参数:
argv
- the commandline options
-