@mengxr The generic interface you noted is correct. However, I think implementing this generic interface and the corresponding implementations is not a minor code change. There are some assumptions in the bin aggregation code that may need to be updated and it also requires adding partition-wise impurity calculation and aggregation.

@mateiz As @mengxr noted, it's highly unlikely that a user will write their own ```Impurity``` implementation. It's mostly an internal API and could be addressed soon in a different PR.

I think we all agree (please correct me if I am wrong) the ```Impurity``` update belongs to a different PR. I can spend time on it immediately after this PR is accepted.

Is this the correct method of marking a method as unstable using the javadoc?
```<span class="badge" style="float: right; background-color: darkblue;">ALPHA COMPONENT</span>```