I have ArrayList of Profile
object. Profile
have properties like age
, gender
, country
, etc.
Are there any library in java which can give descriptive statistics easily like number of female profile, number of male profile, number of female profile from USA, and other complex report.
The environment used is Google App Engine.
Thanks
You can use descriptive statistics in apache commons math e.g.
// Get a DescriptiveStatistics instance
DescriptiveStatistics stats = new DescriptiveStatistics();
// Add the data from the array
for( int i = 0; i < inputArray.length; i++) {
stats.addValue(inputArray[i]);
}
// Compute some statistics
double mean = stats.getMean();
double std = stats.getStandardDeviation();
You will need to add the gender/country information into the descriptiveStatistics provided by commons math. Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With