View regression 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 regression tree or compact regression 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
.
|
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 fitrensemble
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')