The RapidMiner community is on readonly mode until further notice. Technical support via cases will continue to work as is. For any urgent licensing related requests from Students/Faculty members, please use the Altair academic forum here.
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

MartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,525 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 
2015228094 Member Posts: 3 Contributor I
Thank you
Is this formula used for clustring kmean evalution?
do you have the formula as mathematical equation?
0 
MartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,525 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