view
View classification tree
Syntax
view(tree)
view(tree,Name,Value)
Description
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.
Input Arguments
|
A classification tree or compact classification tree created by |
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
|
Value describing the display of Default: |
Examples
Tips
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 byfitcensemble
or a compact ensemble returned bycompact
.Bag
is a full bag of trees returned byTreeBagger
or a compact bag of trees returned bycompact
.
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')