當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。