Classification edge
returns the classification edge for E
= edge(tree
,TBL
,ResponseVarName
)tree
with data
TBL
and classification
TBL.ResponseVarName
.
computes the edge with additional options specified by one or more
E
= edge(___,Name,Value
)Name,Value
pair arguments, using any of the previous
syntaxes. For example, you can specify observation weights.
Compute the classification margin and edge for the Fisher iris data, trained on its first two columns of data, and view the last 10 entries:
load fisheriris
X = meas(:,1:2);
tree = fitctree(X,species);
E = edge(tree,X,species)
E =
0.6299
M = margin(tree,X,species);
M(end-10:end)
ans = 0.1111 0.1111 0.1111 -0.2857 0.6364 0.6364 0.1111 0.7500 1.0000 0.6364 0.2000
The classification tree trained on all the data is better.
tree = fitctree(meas,species); E = edge(tree,meas,species) E = 0.9384 M = margin(tree,meas,species); M(end-10:end)
ans = 0.9565 0.9565 0.9565 0.9565 0.9565 0.9565 0.9565 0.9565 0.9565 0.9565 0.9565