source:
prextra/tree_gini.m
@
160
Last change on this file since 160 was 27, checked in by dtax, 13 years ago | |
---|---|
File size: 103 bytes |
Line | |
---|---|
1 | function g = tree_gini(y,K) |
2 | |
3 | out = zeros(1,K); |
4 | for k=1:K |
5 | out(k) = mean(y==k); |
6 | end |
7 | |
8 | g = out*(1-out)'; |
9 |
Note: See TracBrowser
for help on using the repository browser.