本文整理匯總了Java中org.apache.commons.math3.stat.descriptive.SummaryStatistics.getMax方法的典型用法代碼示例。如果您正苦於以下問題:Java SummaryStatistics.getMax方法的具體用法?Java SummaryStatistics.getMax怎麽用?Java SummaryStatistics.getMax使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.math3.stat.descriptive.SummaryStatistics
的用法示例。
在下文中一共展示了SummaryStatistics.getMax方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getStats
import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //導入方法依賴的package包/類
private static Stats getStats(FloatColumn values, SummaryStatistics summaryStatistics) {
Stats stats = new Stats("Column: " + values.name());
stats.min = (float) summaryStatistics.getMin();
stats.max = (float) summaryStatistics.getMax();
stats.n = summaryStatistics.getN();
stats.sum = summaryStatistics.getSum();
stats.variance = summaryStatistics.getVariance();
stats.populationVariance = summaryStatistics.getPopulationVariance();
stats.quadraticMean = summaryStatistics.getQuadraticMean();
stats.geometricMean = summaryStatistics.getGeometricMean();
stats.mean = summaryStatistics.getMean();
stats.standardDeviation = summaryStatistics.getStandardDeviation();
stats.sumOfLogs = summaryStatistics.getSumOfLogs();
stats.sumOfSquares = summaryStatistics.getSumsq();
stats.secondMoment = summaryStatistics.getSecondMoment();
return stats;
}
示例2: computeStats
import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //導入方法依賴的package包/類
private void computeStats() {
SummaryStatistics centroidStats = new SummaryStatistics();
SummaryStatistics edgeStats = new SummaryStatistics();
for (IFeature poi : pois) {
centroidStats.addValue(getDistToCentroid().get(poi));
edgeStats.addValue(getDistToEdge().get(poi));
}
meanDistanceCentroid = centroidStats.getMean();
stdDistanceCentroid = centroidStats.getStandardDeviation();
minDistanceCentroid = centroidStats.getMin();
maxDistanceCentroid = centroidStats.getMax();
meanDistanceEdge = edgeStats.getMean();
stdDistanceEdge = edgeStats.getStandardDeviation();
minDistanceEdge = edgeStats.getMin();
maxDistanceEdge = edgeStats.getMax();
}
示例3: getSummaryStatisticsForCollection
import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //導入方法依賴的package包/類
/**
* This function will take an aggregated collection of Summary Statistics
* and will generate a derived {@link SummaryStatistic} based on a flag for the
* desired summation. This is particularly helpful for finding out the
* means of the individual statistics of the collection.
* For example, if you wanted to find out the mean of means of the collection
* you would call this function like <p>
* getSummaryStatisticsForCollection(aggregate,1).getMean(); <p>
* Or if you wanted to determine the max number of annotations per
* individual, you could call: <p>
* getSummaryStatisticsForCollection(aggregate,5).getMax(); <p>
* The stat flag should be set to the particular individual statistic that should
* be summarized over.
*
* @param aggregate The aggregated collection of summary statistics
* @param stat Integer flag for the statistic (1:mean ; 2:sum; 3:min; 4:max; 5:N)
* @return {@link SummaryStatistics} of the selected statistic
*/
public SummaryStatistics getSummaryStatisticsForCollection(Collection<SummaryStatistics> aggregate, Stat stat) {
//LOG.info("Computing stats over collection of "+aggregate.size()+" elements ("+stat+"):");
//TODO: turn stat into enum
int x = 0;
//To save memory, I am using SummaryStatistics, which does not store the values,
//but this could be changed to DescriptiveStatistics to see values
//as well as other statistical functions like distributions
SummaryStatistics stats = new SummaryStatistics();
Double v = 0.0;
ArrayList<String> vals = new ArrayList();
for (SummaryStatistics s : aggregate) {
switch (stat) {
case MEAN : v= s.getMean(); stats.addValue(s.getMean()); break;
case SUM : v=s.getSum(); stats.addValue(s.getSum()); break;
case MIN : v=s.getMin(); stats.addValue(s.getMin()); break;
case MAX : v=s.getMax(); stats.addValue(s.getMax()); break;
case N : v= ((int)s.getN())*1.0; stats.addValue(s.getN()); break;
};
//vals.add(v.toString());
};
//LOG.info("vals: "+vals.toString());
return stats;
}
示例4: calculateOverallAnnotationSufficiencyForAttributeSet
import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //導入方法依賴的package包/類
public double calculateOverallAnnotationSufficiencyForAttributeSet(Set<OWLClass> atts) throws UnknownOWLClassException {
SummaryStatistics stats = computeAttributeSetSimilarityStats(atts);
if ((this.getSummaryStatistics() == null) || Double.isNaN(this.getSummaryStatistics().mean.getMean())) {
LOG.info("Stats have not been computed yet - doing this now");
this.computeSystemStats();
}
// score = mean(atts)/mean(overall) + max(atts)/max(overall) + sum(atts)/mean(sum(overall))
double overall_score = 0.0;
Double mean_score = stats.getMean();
Double max_score = stats.getMax();
Double sum_score = stats.getSum();
if (!(mean_score.isNaN() || max_score.isNaN() || sum_score.isNaN())) {
mean_score = StatUtils.min(new double[]{(mean_score / this.overallSummaryStatsPerIndividual.mean.getMean()),1.0});
max_score = StatUtils.min(new double[]{(max_score / this.overallSummaryStatsPerIndividual.max.getMax()),1.0});
sum_score = StatUtils.min(new double[]{(sum_score / this.overallSummaryStatsPerIndividual.sum.getMean()),1.0});
overall_score = (mean_score + max_score + sum_score) / 3;
}
LOG.info("Overall mean: "+mean_score + " max: "+max_score + " sum:"+sum_score + " combined:"+overall_score);
return overall_score;
}
示例5: setWeek
import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //導入方法依賴的package包/類
/**
* Sets min, max, mean, and deviation for a week
*
* @param week Statistics for the week
*/
public void setWeek(SummaryStatistics week)
{
this.weekMin = week.getMin();
this.weekMax = week.getMax();
this.weekAvg = week.getMean();
this.weekDeviation = week.getStandardDeviation();
}
示例6: setMonth
import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //導入方法依賴的package包/類
/**
* Sets min, max, mean, and deviation for a month.
*
* @param month Statistics for the month.
*/
public void setMonth(SummaryStatistics month)
{
this.monthMin = month.getMin();
this.monthMax = month.getMax();
this.monthAvg = month.getMean();
this.monthDeviation = month.getStandardDeviation();
}
示例7: setYear
import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //導入方法依賴的package包/類
/**
* Sets min, max, mean, and deviation for a year.
*
* @param year Statistics for the year.
*/
public void setYear(SummaryStatistics year)
{
this.yearMin = year.getMin();
this.yearMax = year.getMax();
this.yearAvg = year.getMean();
this.yearDeviation = year.getStandardDeviation();
}
示例8: setAll
import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //導入方法依賴的package包/類
/**
* Sets min, max, mean, and deviation for a all.
*
* @param all Statistics for the all.
*/
public void setAll(SummaryStatistics all)
{
this.allMin = all.getMin();
this.allMax = all.getMax();
this.allAvg = all.getMean();
this.allDeviation = all.getStandardDeviation();
}
示例9: calculateSubgraphAnnotationSufficiencyForAttributeSet
import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //導入方法依賴的package包/類
public double calculateSubgraphAnnotationSufficiencyForAttributeSet(Set<OWLClass> atts, OWLClass c) throws UnknownOWLClassException {
SummaryStatistics stats = computeAttributeSetSimilarityStatsForSubgraph(atts,c);
//TODO: compute statsPerIndividual for this subgraph
if ((this.overallSummaryStatsPerIndividual == null ) || (Double.isNaN(this.overallSummaryStatsPerIndividual.max.getMean()))) {
LOG.info("Stats have not been computed yet - doing this now");
this.computeSystemStats();
}
if (!(this.subgraphSummaryStatsPerIndividual.containsKey(c))) {
//only do this once for the whole system, per class requested
this.computeSystemStatsForSubgraph(c);
}
// score = mean(atts)/mean(overall) + max(atts)/max(overall) + sum(atts)/mean(sum(overall))
//TODO: need to normalize this based on the whole corpus
double score = 0.0;
Double mean_score = stats.getMean();
Double max_score = stats.getMax();
Double sum_score = stats.getSum();
if (!(mean_score.isNaN() || max_score.isNaN() || sum_score.isNaN())) {
mean_score = StatUtils.min(new double[]{(mean_score / this.subgraphSummaryStatsPerIndividual.get(c).mean.getMean()),1.0});
max_score = StatUtils.min(new double[]{(max_score / this.subgraphSummaryStatsPerIndividual.get(c).max.getMax()),1.0});
sum_score = StatUtils.min(new double[]{(sum_score / this.subgraphSummaryStatsPerIndividual.get(c).sum.getMean()),1.0});
score = (mean_score + max_score + sum_score) / 3;
}
LOG.info(getShortId(c)+" n: "+stats.getN()+" mean: "+mean_score + " max: "+max_score + " sum:"+sum_score + " combined:"+score);
return score;
}
示例10: getKernel
import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //導入方法依賴的package包/類
@Override
protected RealDistribution getKernel(SummaryStatistics bStats) {
return new UniformRealDistribution(randomData.getRandomGenerator(), bStats.getMin(), bStats.getMax(),
UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
}