|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.AbstractClassifier
weka.classifiers.trees.REPTree
public class REPTree
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)
| Field Summary |
|---|
| Fields inherited from interface weka.core.Drawable |
|---|
BayesNet, Newick, NOT_DRAWABLE, TREE |
| Constructor Summary | |
|---|---|
REPTree()
|
|
| Method Summary | |
|---|---|
void |
buildClassifier(Instances data)
Builds classifier. |
double[] |
distributionForInstance(Instance instance)
Computes class distribution of an instance using the tree. |
Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names. |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
double |
getInitialCount()
Get the value of InitialCount. |
int |
getMaxDepth()
Get the value of MaxDepth. |
double |
getMeasure(String additionalMeasureName)
Returns the value of the named measure. |
double |
getMinNum()
Get the value of MinNum. |
double |
getMinVarianceProp()
Get the value of MinVarianceProp. |
boolean |
getNoPruning()
Get the value of NoPruning. |
int |
getNumFolds()
Get the value of NumFolds. |
String[] |
getOptions()
Gets options from this classifier. |
String |
getRevision()
Returns the revision string. |
int |
getSeed()
Get the value of Seed. |
boolean |
getSpreadInitialCount()
Get the value of SpreadInitialCount. |
String |
globalInfo()
Returns a string describing classifier |
String |
graph()
Outputs the decision tree as a graph |
int |
graphType()
Returns the type of graph this classifier represents. |
String |
initialCountTipText()
Returns the tip text for this property |
Enumeration |
listOptions()
Lists the command-line options for this classifier. |
static void |
main(String[] argv)
Main method for this class. |
String |
maxDepthTipText()
Returns the tip text for this property |
String |
minNumTipText()
Returns the tip text for this property |
String |
minVariancePropTipText()
Returns the tip text for this property |
String |
noPruningTipText()
Returns the tip text for this property |
String |
numFoldsTipText()
Returns the tip text for this property |
int |
numNodes()
Computes size of the tree. |
String |
seedTipText()
Returns the tip text for this property |
void |
setInitialCount(double newInitialCount)
Set the value of InitialCount. |
void |
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. |
void |
setSpreadInitialCount(boolean newSpreadInitialCount)
Set the value of SpreadInitialCount. |
String |
spreadInitialCountTipText()
Returns the tip text for this property |
String |
toSource(String className)
Returns the tree as if-then statements. |
String |
toString()
Outputs the decision tree. |
| Methods inherited from class weka.classifiers.AbstractClassifier |
|---|
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public REPTree()
| Method Detail |
|---|
public String globalInfo()
public String noPruningTipText()
public boolean getNoPruning()
public void setNoPruning(boolean newNoPruning)
newNoPruning - Value to assign to NoPruning.public String minNumTipText()
public double getMinNum()
public void setMinNum(double newMinNum)
newMinNum - Value to assign to MinNum.public String minVariancePropTipText()
public double getMinVarianceProp()
public void setMinVarianceProp(double newMinVarianceProp)
newMinVarianceProp - Value to assign to MinVarianceProp.public String seedTipText()
public int getSeed()
public void setSeed(int newSeed)
newSeed - Value to assign to Seed.public String numFoldsTipText()
public int getNumFolds()
public void setNumFolds(int newNumFolds)
newNumFolds - Value to assign to NumFolds.public String maxDepthTipText()
public int getMaxDepth()
public void setMaxDepth(int newMaxDepth)
newMaxDepth - Value to assign to MaxDepth.public String initialCountTipText()
public double getInitialCount()
public void setInitialCount(double newInitialCount)
newInitialCount - Value to assign to InitialCount.public String spreadInitialCountTipText()
public boolean getSpreadInitialCount()
public void setSpreadInitialCount(boolean newSpreadInitialCount)
newSpreadInitialCount - Value to assign to SpreadInitialCount.public Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class AbstractClassifierpublic String[] getOptions()
getOptions in interface OptionHandlergetOptions in class AbstractClassifier
public void setOptions(String[] options)
throws Exception
-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 in interface OptionHandlersetOptions in class AbstractClassifieroptions - the list of options as an array of strings
Exception - if an option is not supportedpublic int numNodes()
public Enumeration enumerateMeasures()
enumerateMeasures in interface AdditionalMeasureProducerpublic double getMeasure(String additionalMeasureName)
getMeasure in interface AdditionalMeasureProduceradditionalMeasureName - the name of the measure to query for its value
IllegalArgumentException - if the named measure is not supportedpublic Capabilities getCapabilities()
getCapabilities in interface ClassifiergetCapabilities in interface CapabilitiesHandlergetCapabilities in class AbstractClassifierCapabilities
public void buildClassifier(Instances data)
throws Exception
buildClassifier in interface Classifierdata - the data to train with
Exception - if building fails
public double[] distributionForInstance(Instance instance)
throws Exception
distributionForInstance in interface ClassifierdistributionForInstance in class AbstractClassifierinstance - the instance to compute the distribution for
Exception - if computation fails
public String toSource(String className)
throws Exception
toSource in interface SourcableclassName - the name for the generated class
Exception - if something goes wrongpublic int graphType()
graphType in interface Drawable
public String graph()
throws Exception
graph in interface DrawableException - if generation failspublic String toString()
toString in class Objectpublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class AbstractClassifierpublic static void main(String[] argv)
argv - the commandline options
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||