| Statistics Toolbox™ | ![]() |
ib = isbranch(t)
ib = isbranch(t,nodes)
ib = isbranch(t) returns an n-element logical vector ib that is true for each branch node and false for each leaf node.
ib = isbranch(t,nodes) takes a vector nodes of node numbers and returns a vector of logical values for the specified nodes.
Create a classification tree for Fisher's iris data:
load fisheriris;
t = classregtree(meas,species,...
'names',{'SL' 'SW' 'PL' 'PW'})
t =
Decision tree for classification
1 if PL<2.45 then node 2 else node 3
2 class = setosa
3 if PW<1.75 then node 4 else node 5
4 if PL<4.95 then node 6 else node 7
5 class = virginica
6 if PW<1.65 then node 8 else node 9
7 class = virginica
8 class = versicolor
9 class = virginica
view(t)

ib = isbranch(t)
ib =
1
0
1
1
0
1
0
0
0[1] Breiman, L., J. Friedman, R. Olshen, and C. Stone. Classification and Regression Trees. Boca Raton, FL: CRC Press, 1984.
classregtree, numnodes, cutvar
![]() | iqr | islevel | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |