public class CDT extends REPTree implements OptionHandler, WeightedInstancesHandler, Drawable, AdditionalMeasureProducer, Sourcable
Decision tree learner based on imprecise probabilities and uncertainty measures. See:
J. Abellán, S. Moral Building classification trees using the total uncertainty criterion Int. J. Intell. Syst., 18 (12) (2003), pp. 1215–1225
It uses reduced-error pruning (with backfitting) and sorted values for numeric attributes. Missing values are treated like 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 <depth> Maximum tree depth (default -1, no maximum)
-SIDM <s> S parameter used in the Imprecise Dirichlet Model to obtain imprecise probabilities as intervals. By default s=1.
-KTHRootAttribute <k> This value is used to fix the root node of the tree (using k-th highest variable of a rank based on Information Gain using imprecise probabilities). By default is k=1.
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
BayesNet, Newick, NOT_DRAWABLE, TREE
Constructor and Description |
---|
CDT() |
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances data)
Builds classifier.
|
double[] |
distributionForInstance(Instance instance)
Computes class distribution of an instance using the tree.
|
int |
getKTHRootAttribute()
This method gets the position of the node in a rank to be used as root
node in a decision tree (for the IRNV ensemble).
|
java.lang.String[] |
getOptions()
Gets options from this classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
double |
getSValue()
This method gets the s parameter used in the Imprecise Dirichlet model
to obtain imprecise probabilities.
|
java.lang.String |
globalInfo()
Returns a string describing classifier
|
java.lang.String |
graph()
Outputs the decision tree as a graph.
|
java.lang.String |
KTHRootAttributeTipText()
Returns the tip text for this property
|
java.util.Enumeration |
listOptions()
Lists the command-line options for this classifier.
|
static void |
main(java.lang.String[] argv)
Main method for this class.
|
int |
numNodes()
Computes size of the tree.
|
void |
setKTHRootAttribute(int k)
This method stores the position of the node in a rank to be used as root
node in a decision tree (for the IRNV ensemble).
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setSValue(double m_SValue)
Set the s parameter used in the Imprecise Dirichlet model to obtain
imprecise probabilities.
|
java.lang.String |
SValueTipText()
Returns the tip text for this property
|
java.lang.String |
toSource(java.lang.String className)
Returns the tree as if-then statements.
|
java.lang.String |
toString()
Outputs the decision tree.
|
enumerateMeasures, generatePartition, getCapabilities, getInitialCount, getMaxDepth, getMeasure, getMembershipValues, getMinNum, getMinVarianceProp, getNoPruning, getNumFolds, getSeed, getSpreadInitialCount, graphType, initialCountTipText, maxDepthTipText, minNumTipText, minVariancePropTipText, noPruningTipText, numElements, numFoldsTipText, seedTipText, setInitialCount, setMaxDepth, setMinNum, setMinVarianceProp, setNoPruning, setNumFolds, setSeed, setSpreadInitialCount, spreadInitialCountTipText
batchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
enumerateMeasures, getMeasure
public java.lang.String globalInfo()
globalInfo
in class REPTree
public double getSValue()
public void setSValue(double m_SValue)
m_SValue
- s parameter of the IDMpublic java.lang.String SValueTipText()
public void setKTHRootAttribute(int k)
k
- position in the rank to be used as root node.public int getKTHRootAttribute()
public java.lang.String KTHRootAttributeTipText()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class REPTree
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class REPTree
public void setOptions(java.lang.String[] options) throws java.lang.Exception
Parses a given list of options.
-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)
-SIDM S parameter used in the Imprecise Dirichlet Model to obtain imprecise probabilities as intervals. By default s=1.
-KTHRootAttribute This value is used to fix the root node of the tree (using k-th highest variable of a rank based on Information Gain using imprecise probabilities). By default is k=1.
setOptions
in interface OptionHandler
setOptions
in class REPTree
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in interface Classifier
buildClassifier
in class REPTree
data
- the data to train withjava.lang.Exception
- if building failspublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in interface Classifier
distributionForInstance
in class REPTree
instance
- the instance to compute the distribution forjava.lang.Exception
- if computation failspublic int numNodes()
public java.lang.String toSource(java.lang.String className) throws java.lang.Exception
public java.lang.String graph() throws java.lang.Exception
public java.lang.String toString()
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class REPTree
public static void main(java.lang.String[] argv)
argv
- the commandline options