View classification tree
view(tree)
view(tree,Name,Value)
view(
returns
a text description of tree
)tree
, a decision tree.
view(
describes tree
,Name,Value
)tree
with
additional options specified by one or more Name,Value
pair
arguments.
|
A classification tree or compact classification tree created
by |
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
|
Value describing the display of Default: |
To view tree t
from an ensemble of trees, enter one of these lines
of code
view(Ens.Trained{t}) view(Bag.Trees{t})
Ens
is a full ensemble returned by fitcensemble
or a compact
ensemble returned by compact
.
Bag
is a full bag of trees returned by TreeBagger
or a compact bag of trees returned by compact
.
To save tree
in the Command Window, get a
figure handle by using the findall
and setdiff
functions, and then save tree
using the function
saveas
.
before = findall(groot,'Type','figure'); % Find all figures view(Mdl,'Mode','graph') after = findall(groot,'Type','figure'); h = setdiff(after,before); % Get the figure handle of the tree viewer saveas(h,'a.png')