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


Java Mean.increment方法代码示例

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


在下文中一共展示了Mean.increment方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reduce

import org.apache.commons.math.stat.descriptive.moment.Mean; //导入方法依赖的package包/类
public void reduce(Text key,
                   Iterator<DoubleWritable> values,
                   OutputCollector<AvroWrapper<StockAvg>,
                       NullWritable> output,
                   Reporter reporter) throws IOException {

  Mean mean = new Mean();
  while (values.hasNext()) {
    mean.increment(values.next().get());
  }
  StockAvg avg = new StockAvg();
  avg.setSymbol(key.toString());
  avg.setAvg(mean.getResult());
  output.collect(new AvroWrapper<StockAvg>(avg),
      NullWritable.get());
}
 
开发者ID:Hanmourang,项目名称:hiped2,代码行数:17,代码来源:AvroMixedMapReduce.java

示例2: reduce

import org.apache.commons.math.stat.descriptive.moment.Mean; //导入方法依赖的package包/类
@Override
protected void reduce(Text key, Iterable<DoubleWritable> values, Context context) throws IOException, InterruptedException {
  Mean mean = new Mean();
  for (DoubleWritable val: values) {
    mean.increment(val.get());
  }
  StockAvg avg = new StockAvg();
  avg.setSymbol(key.toString());
  avg.setAvg(mean.getResult());
  context.write(key, new AvroValue<StockAvg>(avg));
}
 
开发者ID:Hanmourang,项目名称:hiped2,代码行数:12,代码来源:AvroKeyValueMapReduce.java

示例3: reduce

import org.apache.commons.math.stat.descriptive.moment.Mean; //导入方法依赖的package包/类
@Override
public void reduce(Utf8 symbol, Iterable<Stock> stocks,
                   AvroCollector<StockAvg> collector,
                   Reporter reporter) throws IOException {

  Mean mean = new Mean();
  for (Stock stock : stocks) {
    mean.increment(stock.getOpen());
  }
  StockAvg avg = new StockAvg();
  avg.setSymbol(symbol.toString());
  avg.setAvg(mean.getResult());

  collector.collect(avg);
}
 
开发者ID:Hanmourang,项目名称:hiped2,代码行数:16,代码来源:AvroRecordMapReduce.java

示例4: reduce

import org.apache.commons.math.stat.descriptive.moment.Mean; //导入方法依赖的package包/类
@Override
protected void reduce(Text key, Iterable<DoubleWritable> values, Context context) throws IOException, InterruptedException {
  Mean mean = new Mean();
  for (DoubleWritable val : values) {
    mean.increment(val.get());
  }
  Group group = factory.newGroup()
      .append("symbol", key.toString())
      .append("avg", mean.getResult());
  context.write(null, group);
}
 
开发者ID:Hanmourang,项目名称:hiped2,代码行数:12,代码来源:ExampleParquetMapReduce.java

示例5: reduce

import org.apache.commons.math.stat.descriptive.moment.Mean; //导入方法依赖的package包/类
@Override
protected void reduce(Text key, Iterable<DoubleWritable> values, Context context) throws IOException, InterruptedException {
  Mean mean = new Mean();
  for (DoubleWritable val : values) {
    mean.increment(val.get());
  }
  StockAvg avg = new StockAvg();
  avg.setSymbol(key.toString());
  avg.setAvg(mean.getResult());
  context.write(null, avg);
}
 
开发者ID:Hanmourang,项目名称:hiped2,代码行数:12,代码来源:AvroParquetMapReduce.java

示例6: getMeanStateStringSize

import org.apache.commons.math.stat.descriptive.moment.Mean; //导入方法依赖的package包/类
@Override
public int getMeanStateStringSize() {
	readLock.lock();
	try {
		final Mean mean = new Mean();

		for (StateVertex state : sfg.vertexSet()) {
			mean.increment(state.getDom().getBytes().length);
		}

		return (int) mean.getResult();
	} finally {
		readLock.unlock();
	}
}
 
开发者ID:aminmf,项目名称:crawljax,代码行数:16,代码来源:InMemoryStateFlowGraph.java


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