• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Median类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.commons.math.stat.descriptive.rank.Median的典型用法代码示例。如果您正苦于以下问题:Java Median类的具体用法?Java Median怎么用?Java Median使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Median类属于org.apache.commons.math.stat.descriptive.rank包,在下文中一共展示了Median类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getSummaryStatistics

import org.apache.commons.math.stat.descriptive.rank.Median; //导入依赖的package包/类
public static Double[] getSummaryStatistics(Double[] variable){

        double[] primitiveVariable = new double[variable.length];
        for(int i=0; i<variable.length; i++){
            primitiveVariable[i] = variable[i];
        }

        Double[] out = new Double[4];
        out[0] = (new Mean()).evaluate(primitiveVariable);
        out[1] = (new Median()).evaluate(primitiveVariable);
        out[2] = (new Variance()).evaluate(primitiveVariable);
        out[3] = Math.sqrt(out[2]);
        return out;
    }
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:15,代码来源:CaseToCaseTreeLikelihood.java


示例2: export

import org.apache.commons.math.stat.descriptive.rank.Median; //导入依赖的package包/类
@Override
public void export(RandomAccessMDLReader reader, EncodingFingerprint fingerprinter, String label, File outputFile, boolean useAromaticFlag) {
	DecimalFormat df = new DecimalFormat();
	double[] features = new double[reader.getSize()];
	
	Long start = System.currentTimeMillis();
	for (int indexMol = 0; indexMol < reader.getSize(); indexMol++) {
		if ((indexMol != 0) && (indexMol % 1000 == 0))
			System.out.println("encodings/s = " 
					+ df.format(((double) indexMol) / ((double) ((System.currentTimeMillis() - start) / 1000))) 
					+ "\t(mappings so far = " + indexMol + ", @" 
					+ df.format(((double) indexMol / (double) reader.getSize()) * 100) + "%)");

		IAtomContainer mol = reader.getMol(indexMol);
		FeatureMap featureMap = new FeatureMap(fingerprinter.getFingerprint(mol));
		features[indexMol] = featureMap.getKeySet().size();
	}
	Long end = System.currentTimeMillis();
	
	Mean mean = new Mean();
	StandardDeviation stdv = new StandardDeviation();
	Max max = new Max();
	Median median = new Median();

	System.out.println("Time elapsed: " + (end - start) + " ms");
	System.out.println("mol/s = " + df.format(reader.getSize() / ((double) (end - start) / 1000)));
	System.out.println("no. features = " + df.format(mean.evaluate(features)) + "\t" + df.format(stdv.evaluate(features)));
	System.out.println("Max = " + df.format(max.evaluate(features)));
	System.out.println("Median = " + df.format(median.evaluate(features)));
}
 
开发者ID:fortiema,项目名称:jCompoundMapper,代码行数:31,代码来源:ExporterBenchmark.java


示例3: initialize

import org.apache.commons.math.stat.descriptive.rank.Median; //导入依赖的package包/类
private void initialize(Filter<Pair<WellKey,ResultValue>> scoringFilter,
                        AggregateFunction<Double> scoringFunc)
{

  Collection<Double> aggregationValues = new ArrayList<Double>();
  for (WellKey wellKey : _resultValues.keySet()) {
    if (wellKey.getPlateNumber() == _plateNumber) {
      ResultValue rv = getResultValue(wellKey.getRow(), wellKey.getColumn());
      if (rv != null && !scoringFilter.exclude(new Pair<WellKey,ResultValue>(wellKey, rv))) {
        aggregationValues.add(getRawValue(wellKey.getRow(), wellKey.getColumn()));
      }
    }
  }
  
  scoringFunc.initializeAggregates(aggregationValues);

  _statistics = new DescriptiveStatisticsImpl();
  ResizableDoubleArray medianValues = new ResizableDoubleArray();
  for (Double rawValue : aggregationValues) {
    double scoredValue = scoringFunc.compute(rawValue);
    _statistics.addValue(scoredValue);
    medianValues.addElement(scoredValue);
  }

  _median = new Median().evaluate(medianValues.getElements());

  _scalableColorFunction.setLowerLimit(_statistics.getMin());
  _scalableColorFunction.setUpperLimit(_statistics.getMax());
}
 
开发者ID:hmsiccbl,项目名称:screensaver,代码行数:30,代码来源:HeatMap.java


示例4: getMedianTestScore

import org.apache.commons.math.stat.descriptive.rank.Median; //导入依赖的package包/类
/**
 * <p>
 * Calculate the median score achieved on a Test.
 * </p>
 */
public static double getMedianTestScore(int testID)
    throws SQLException
{
    Logger              log = Logger.getLogger();
    boolean             loggingEnabled = log.isLoggingEnabled();
    Median              median = new Median();
    ArrayList           arraylist = new ArrayList();
    Connection          conn = getDefaultConnection();

    try {
        log.enableLogging( false );
        
        PreparedStatement   ps = Utils.prepare
            (
             conn,
             "select tk.score\n" +
             "from TestTaking tk, LastTaking lt\n" +
             "where tk.takingID = lt.takingID\n" +
             "and tk.testID = ?\n"
             );
        
        ps.setInt( 1, testID );
        
        ResultSet           rs = ps.executeQuery();
        
        while( rs.next() )
        {
            arraylist.add(new Double(rs.getDouble(1)));
        }
        
        Utils.close(rs);
        Utils.close(ps);
    }
    finally
    {
        log.enableLogging( loggingEnabled );
    }

    int                 count = arraylist.size();
    double              values[] = new double[ count ];

    for ( int i = 0; i < count; i++)
    { values[ i ] = ((Double)arraylist.get(i)).doubleValue(); }

    return median.evaluate( values );
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:52,代码来源:Functions.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BidResponse类代码示例发布时间:2022-05-23
下一篇:
Java BshClassPath类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap