Last change
on this file since 160 was
27,
checked in by dtax, 13 years ago
|
This is obviously also needed... Here they are!
|
File size:
362 bytes
|
Line | |
---|
1 | % out = tree_eval(w,x) |
---|
2 | % |
---|
3 | function out = tree_eval(w,x) |
---|
4 | |
---|
5 | n = size(x,1); |
---|
6 | out = zeros(n,1); |
---|
7 | |
---|
8 | for i=1:n |
---|
9 | |
---|
10 | v=w; |
---|
11 | % if the first split is already solving everything (1 obj. per class) |
---|
12 | if isa(v,'double') |
---|
13 | out(i,1) = v; |
---|
14 | end |
---|
15 | while (out(i,1)==0) |
---|
16 | if (x(i,v.bestf)<v.bestt) |
---|
17 | v = v.l; |
---|
18 | else |
---|
19 | v = v.r; |
---|
20 | end |
---|
21 | if isa(v,'double') |
---|
22 | out(i,1) = v; |
---|
23 | end |
---|
24 | end |
---|
25 | end |
---|
26 | |
---|
Note: See
TracBrowser
for help on using the repository browser.