Some basic data mining API's

Very generically written. Denominator in terms of percentages are only
accurate when partitions are explicitly defined rather then naturally
defined. Natural use is for exact values only.

Probably should redefine it such that partitions are % based while or
something like that? I don't want to mix the group by and partion over
logics however so need to refactor the concept slightly I think.