A Presentation On The Implementation of Decision Trees in Matlab
A Presentation On The Implementation of Decision Trees in Matlab
2
Avirup Sil
CIS 9603
AI Course
3
Avirup Sil
How to use
classregtree
CIS 9603
AI Course
function??
t=classregtree(X,y,'Name',value)
4
Avirup Sil
CIS 9603
AI Course
Parameter Options
For all trees:
categorical Vector of indices of the columns of X that are to be
treated as unordered categorical variables
method Either 'classification' (default if y is text or a categorical
variable) or 'regression' (default if y is numeric).
names A cell array of names for the predictor variables, in the
order in which they appear in the X from which the tree was created.
prune 'on' (default) to compute the full tree and the optimal
sequence of pruned subtrees, or 'off' for the full tree without pruning.
minparent A number k such that impure nodes must have k or
more observations to be split (default is 10).
5
Avirup Sil
CIS 9603
AI Course
Parameter Options(contd)
minleaf A minimal number of observations per tree leaf (default
is 1). If you supply both 'minparent' and 'minleaf', classregtree uses
the setting which results in larger leaves: minparent =
max(minparent,2*minleaf)
surrogate 'on' to find surrogate splits at each branch node.
Default is 'off'. If you set this parameter to 'on',classregtree can run
significantly slower and consume significantly more memory.
(I could not use surrogate in my MATLAB!!!)
weights Vector of observation weights. By default the weight of
every observation is 1. The length of this vector must be equal to the
number of rows in X.
6
Avirup Sil
CIS 9603
AI Course
Parameter Options(contd)
For Classification Trees:
splitcriterion Criterion for choosing a split.
One of 'gdi' (default) or Gini's diversity index,
'twoing' for the twoing rule, or 'deviance' for
maximum deviance reduction.
7
Avirup Sil
Demos
To be shown in class
CIS 9603
AI Course
8
Avirup Sil
CIS 9603
AI Course
References
Matlab Library
http://www.mathworks.es/help/toolbox/stats/c
lassregtree.html
9
Avirup Sil
Thank You!!
CIS 9603
AI Course