source: prextra/tree_gini.m @ 160

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: 103 bytes
Line 
1function g = tree_gini(y,K)
2
3out = zeros(1,K);
4for k=1:K
5        out(k) = mean(y==k);
6end
7
8g = out*(1-out)';
9
Note: See TracBrowser for help on using the repository browser.