当前位置: 首页>>代码示例>>Java>>正文


Java SummaryStatistics.getStandardDeviation方法代码示例

本文整理汇总了Java中org.apache.commons.math3.stat.descriptive.SummaryStatistics.getStandardDeviation方法的典型用法代码示例。如果您正苦于以下问题:Java SummaryStatistics.getStandardDeviation方法的具体用法?Java SummaryStatistics.getStandardDeviation怎么用?Java SummaryStatistics.getStandardDeviation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.math3.stat.descriptive.SummaryStatistics的用法示例。


在下文中一共展示了SummaryStatistics.getStandardDeviation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:18,代码来源:Stats.java

示例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();
}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:17,代码来源:BuildingConsistencyQualityAssessment.java

示例3: allocateTokens

import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //导入方法依赖的package包/类
public static Collection<Token> allocateTokens(final TokenMetadata tokenMetadata,
                                               final AbstractReplicationStrategy rs,
                                               final InetAddress endpoint,
                                               int numTokens)
{
    StrategyAdapter strategy = getStrategy(tokenMetadata, rs, endpoint);
    Collection<Token> tokens = create(tokenMetadata, strategy).addUnit(endpoint, numTokens);
    tokens = adjustForCrossDatacenterClashes(tokenMetadata, strategy, tokens);

    if (logger.isWarnEnabled())
    {
        logger.warn("Selected tokens {}", tokens);
        SummaryStatistics os = replicatedOwnershipStats(tokenMetadata, rs, endpoint);
        TokenMetadata tokenMetadataCopy = tokenMetadata.cloneOnlyTokenMap();
        tokenMetadataCopy.updateNormalTokens(tokens, endpoint);
        SummaryStatistics ns = replicatedOwnershipStats(tokenMetadataCopy, rs, endpoint);
        logger.warn("Replicated node load in datacentre before allocation " + statToString(os));
        logger.warn("Replicated node load in datacentre after allocation " + statToString(ns));

        // TODO: Is it worth doing the replicated ownership calculation always to be able to raise this alarm?
        if (ns.getStandardDeviation() > os.getStandardDeviation())
            logger.warn("Unexpected growth in standard deviation after allocation.");
    }
    return tokens;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:26,代码来源:TokenAllocation.java

示例4: initialiseGaussianDistributionForNumericAttribute

import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //导入方法依赖的package包/类
private Map<Attribute, Map<Double, NormalDistribution>> initialiseGaussianDistributionForNumericAttribute(Instance instanceInfo, ArrayList<Instance> instancesList){
	
	Map<Attribute, Map<Double, NormalDistribution>> numericAttributeClassGaussDistributions = new HashMap<>();
	
	// go through each numeric attibute
	for (Attribute attribute : Collections.list(instanceInfo.enumerateAttributes())) {
		
		// check whether the attribute is numeric
		if(attribute.isNumeric()){
			
			// for each class label
			HashMap<Double, NormalDistribution> classLabelDistribution = new HashMap<>();
			for (int classLabelNo = 0; classLabelNo < instanceInfo.numClasses(); classLabelNo++) {
				
				// go through all instance in the dataset to create normal distribution
				SummaryStatistics summaryStatistics = new SummaryStatistics();
				for (Instance instance : instancesList) {
					
					summaryStatistics.addValue(instance.value(attribute));
				}
				
				// create normal distribution for this attribute with corresponding
				// class label
				NormalDistribution normalDistribution = new NormalDistribution(
						summaryStatistics.getMean(), 
						summaryStatistics.getStandardDeviation());
				
				// map to hold classLabel and distribution
				classLabelDistribution.put((double) classLabelNo, normalDistribution);
				
			}
			
			// put it into the map
			numericAttributeClassGaussDistributions.put(attribute, classLabelDistribution);
		}
		
	}
				
	return numericAttributeClassGaussDistributions;
}
 
开发者ID:thienle2401,项目名称:G-eRules,代码行数:41,代码来源:GeRules.java

示例5: getSummaryStats

import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //导入方法依赖的package包/类
public void getSummaryStats(double[] values){
	SummaryStatistics stats = new SummaryStatistics();
	for( int i = 0; i < values.length; i++) {
	        stats.addValue(values[i]);
	}
	double mean = stats.getMean();
	double std = stats.getStandardDeviation();
	System.out.println(mean + "\t" + std);
}
 
开发者ID:PacktPublishing,项目名称:Java-Data-Science-Cookbook,代码行数:10,代码来源:SummaryStats.java

示例6: spectrogramMeanSd

import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //导入方法依赖的package包/类
/**
 * @param spectrogram
 * @return double[]{mean, sd}
 */
public static double[] spectrogramMeanSd(List<float[]> spectrogram)
{
	SummaryStatistics stat=new SummaryStatistics();
	for(float[] spec: spectrogram) for(float v: spec) stat.addValue(v);
	return new double[]{stat.getMean(), stat.getStandardDeviation()};
}
 
开发者ID:cycentum,项目名称:birdsong-recognition,代码行数:11,代码来源:SoundUtils.java

示例7: SubGraph

import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //导入方法依赖的package包/类
public SubGraph(int subGraphId, Collection<Integer> itemIndices, SummaryStatistics summaryStatisticsQ, SummaryStatistics summaryStatisticsArea) {
  minInit(subGraphId, itemIndices, (float) summaryStatisticsQ.getMean());
  standardDeviationQ = (float) summaryStatisticsQ.getStandardDeviation();
  meanArea = (float) summaryStatisticsArea.getMean();
  standardDeviationArea = (float) summaryStatisticsArea.getStandardDeviation();
  debug();
}
 
开发者ID:Orange-OpenSource,项目名称:documentare-simdoc,代码行数:8,代码来源:SubGraph.java

示例8: computeStats

import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //导入方法依赖的package包/类
private void computeStats() {
  SummaryStatistics centroidStats = new SummaryStatistics();
  SummaryStatistics edgeStats = new SummaryStatistics();
  for (IFeature atm : atms) {
    centroidStats.addValue(getDistToCentroid().get(atm));
    edgeStats.addValue(getDistToEdge().get(atm));
  }
  meanDistanceCentroid = centroidStats.getMean();
  stdDistanceCentroid = centroidStats.getStandardDeviation();
  meanDistanceEdge = edgeStats.getMean();
  stdDistanceEdge = edgeStats.getStandardDeviation();
}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:13,代码来源:ATMQualityAssessment.java

示例9: applyGlobalFilter

import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //导入方法依赖的package包/类
/**
 * Applies a global filter on pitches in S1 and moves all pitches whose salience is bellow a certain
 * threshold from S1 to S0. This filter is described in [1], section II-C.
 */
private void applyGlobalFilter() {
    SummaryStatistics statistics = new SummaryStatistics();

    /* Iteration #1: Gather data to obtain salience statistics. */
    for (int t=0; t<this.s1.length; t++) {
        for (int i=0; i<this.s1[t].length; i++) {
            if (this.s1[t][i] == null) {
              continue;
            }
            statistics.addValue(this.s1[t][i].getSalience());
        }
    }

    /* Iteration #2: Move pitches that are bellow the threshold. */
    final double threshold = statistics.getMean() - this.t2 * statistics.getStandardDeviation();
    for (int t=0; t<this.s1.length; t++) {
        for (int i=0; i<this.s1[t].length; i++) {
            if (this.s1[t][i] == null) {
              continue;
            }
            if (this.s1[t][i].getSalience() < threshold) {
                this.moveToS0(t,i);
            }
        }
    }
}
 
开发者ID:vitrivr,项目名称:cineast,代码行数:31,代码来源:PitchTracker.java

示例10: 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();
}
 
开发者ID:MTUHIDE,项目名称:CoCoTemp,代码行数:13,代码来源:SiteStatistics.java

示例11: 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();
}
 
开发者ID:MTUHIDE,项目名称:CoCoTemp,代码行数:13,代码来源:SiteStatistics.java

示例12: 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();
}
 
开发者ID:MTUHIDE,项目名称:CoCoTemp,代码行数:13,代码来源:SiteStatistics.java

示例13: 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();
}
 
开发者ID:MTUHIDE,项目名称:CoCoTemp,代码行数:13,代码来源:SiteStatistics.java

示例14: getKernel

import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //导入方法依赖的package包/类
/**
 * The within-bin smoothing kernel. Returns a Gaussian distribution
 * parameterized by {@code bStats}, unless the bin contains only one
 * observation, in which case a constant distribution is returned.
 *
 * @param bStats summary statistics for the bin
 * @return within-bin kernel parameterized by bStats
 */
protected RealDistribution getKernel(SummaryStatistics bStats) {
    if (bStats.getN() == 1 || bStats.getVariance() == 0) {
        return new ConstantRealDistribution(bStats.getMean());
    } else {
        return new NormalDistribution(randomData.getRandomGenerator(),
            bStats.getMean(), bStats.getStandardDeviation(),
            NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:18,代码来源:EmpiricalDistribution.java

示例15: getKernel

import org.apache.commons.math3.stat.descriptive.SummaryStatistics; //导入方法依赖的package包/类
/**
 * The within-bin smoothing kernel. Returns a Gaussian distribution
 * parameterized by {@code bStats}, unless the bin contains only one
 * observation, in which case a constant distribution is returned.
 *
 * @param bStats summary statistics for the bin
 * @return within-bin kernel parameterized by bStats
 */
protected RealDistribution getKernel(SummaryStatistics bStats) {
    if (bStats.getN() == 1) {
        return new ConstantRealDistribution(bStats.getMean());
    } else {
        return new NormalDistribution(randomData.getRandomGenerator(),
            bStats.getMean(), bStats.getStandardDeviation(),
            NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
    }
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:18,代码来源:EmpiricalDistribution.java


注:本文中的org.apache.commons.math3.stat.descriptive.SummaryStatistics.getStandardDeviation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。