source: prextra/tree_gini.m @ 113

Last change on this file since 113 was 27, checked in by dtax, 12 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.