Options
calculating gini index
2015228094
Member Posts: 3 Contributor I
I want to what type of Gini coeffcient used in item distribution and what is the formula to calculate Gini coeffcient and Gini index
Tagged:
0
Best Answers

OptionsMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,507 RM Data Scientist
Hi,
the one used in Trees and Weight By Gini can be found here:
Best,
Martin
 Sr. Director Data Solutions, Altair RapidMiner 
Dortmund, Germany1 
Options2015228094 Member Posts: 3 Contributor I
Thank you
Is this formula used for clustring kmean evalution?
do you have the formula as mathematical equation?
0 
OptionsMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,507 RM Data Scientist
Hi,
for clustering its: https://github.com/rapidminer/rapidminerstudio/blob/master/src/main/java/com/rapidminer/operator/validation/clustering/exampledistribution/GiniCoefficient.java
or in code
double sum = 0;
for (int i = 0; i < x.length; i++) {
sum = sum + x[i];
}
double mean = sum / n;
sum = 0;
for (int i = 0; i < x.length; i++) {
for (int j = 0; j < x.length; j++) {
sum = sum + Math.abs(x[i]  x[j]);
}
}
if (mean == 0) {
return 0.0;
}
return 1  (sum / (2 * mean * (n * ((double) n  1))));Best,
Martin
 Sr. Director Data Solutions, Altair RapidMiner 
Dortmund, Germany1