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


Java DescriptiveStatistics.getMin方法代码示例

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


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

示例1: getMin

import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; //导入方法依赖的package包/类
public Double getMin(final String feature) {
	final DescriptiveStatistics stat = stats.get(feature);
	return stat == null ? null : stat.getMin();
}
 
开发者ID:ProfilingIO,项目名称:insight-ml,代码行数:5,代码来源:FeatureStatistics.java

示例2: process

import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; //导入方法依赖的package包/类
@Override
public Data process(Data input) {
    Utils.isKeyValid(input, "NPIX", Integer.class);
    npix = (Integer) input.get("NPIX");

    int roi = (Integer) input.get("NROI");

    Utils.checkWindow(searchWindowLeft, searchWindowRight - searchWindowLeft, 0, roi);

    Utils.mapContainsKeys(input, dataKey);

    double[] data = (double[]) input.get(dataKey);

    double[] movingAverage;

    if (movingAverageKey != null) {
        movingAverage = (double[]) input.get(movingAverageKey);
    } else {
        movingAverage = new double[data.length];
    }


    double[] mean = new double[npix];
    double[] median = new double[npix];
    double[] mode = new double[npix];
    double[] std = new double[npix];
    double[] kurtosis = new double[npix];
    double[] skewness = new double[npix];
    double[] min = new double[npix];
    double[] max = new double[npix];
    double[] quantil25 = new double[npix];
    double[] quantil75 = new double[npix];

    for (int pix = 0; pix < npix; pix++) {
        double[] values = new double[searchWindowRight - searchWindowLeft];
        for (int sl = searchWindowLeft; sl < searchWindowRight; sl++) {
            int slice = pix * roi + sl;
            values[sl - searchWindowLeft] = data[slice];
            int binNumber = findBinNumber((data[slice] - movingAverage[slice]));
            histogram[binNumber] += 1;
        }
        DescriptiveStatistics stats = new DescriptiveStatistics(values);
        mean[pix] = stats.getMean();
        min[pix] = stats.getMin();
        max[pix] = stats.getMax();
        std[pix] = stats.getStandardDeviation();
        skewness[pix] = stats.getSkewness();
        kurtosis[pix] = stats.getKurtosis();

        Percentile percentile = new Percentile();
        median[pix] = percentile.evaluate(values, 0.5);
        quantil25[pix] = percentile.evaluate(values, 0.25);
        quantil75[pix] = percentile.evaluate(values, 0.75);

        double[] modeArray = StatUtils.mode(values);
        mode[pix] = modeArray[0];
    }

    input.put(outputKey + "_mean", mean);
    input.put(outputKey + "_median", median);
    input.put(outputKey + "_mode", mode);
    input.put(outputKey + "_std", std);
    input.put(outputKey + "_kurtosis", kurtosis);
    input.put(outputKey + "_skewness", skewness);
    input.put(outputKey + "_min", min);
    input.put(outputKey + "_max", max);
    input.put(outputKey + "_quantil25", quantil25);
    input.put(outputKey + "_quantil75", quantil75);
    input.put(outputKey + "_histogram", histogram);


    return input;
}
 
开发者ID:fact-project,项目名称:fact-tools,代码行数:74,代码来源:TimeseriesFeatures.java

示例3: process

import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; //导入方法依赖的package包/类
@Override
public Data process(Data item) {
    Utils.isKeyValid(item, "NPIX", Integer.class);
    npix = (Integer) item.get("NPIX");

    Utils.mapContainsKeys(item, dataKey);

    int[][] data = (int[][]) item.get(dataKey);

    double[] mean = new double[npix];
    double[] median = new double[npix];
    double[] mode = new double[npix];
    double[] std = new double[npix];
    double[] kurtosis = new double[npix];
    double[] skewness = new double[npix];
    double[] min = new double[npix];
    double[] max = new double[npix];
    double[] quantil25 = new double[npix];
    double[] quantil75 = new double[npix];

    for (int pix = 0; pix < npix; pix++) {
        double[] values = Utils.toDoubleArray(data[pix]);


        ///FIXME: fill nans instead of continue
        if (values.length == 0) {
            continue;
        }

        DescriptiveStatistics stats = new DescriptiveStatistics(values);
        mean[pix] = stats.getMean();
        min[pix] = stats.getMin();
        max[pix] = stats.getMax();
        std[pix] = stats.getStandardDeviation();
        skewness[pix] = stats.getSkewness();
        kurtosis[pix] = stats.getKurtosis();
        quantil25[pix] = stats.getPercentile(0.25);
        quantil75[pix] = stats.getPercentile(0.75);
        median[pix] = stats.getPercentile(0.5);

        double[] modeArray = StatUtils.mode(values);
        mode[pix] = modeArray[0];
    }

    item.put(outputKey + "_mean", mean);
    item.put(outputKey + "_median", median);
    item.put(outputKey + "_mode", mode);
    item.put(outputKey + "_std", std);
    item.put(outputKey + "_kurtosis", kurtosis);
    item.put(outputKey + "_skewness", skewness);
    item.put(outputKey + "_min", min);
    item.put(outputKey + "_max", max);
    item.put(outputKey + "_quantil25", quantil25);
    item.put(outputKey + "_quantil75", quantil75);


    return item;
}
 
开发者ID:fact-project,项目名称:fact-tools,代码行数:59,代码来源:SinglePeStatisticsPixel.java


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