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


Java Skewness类代码示例

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


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

示例1: skewness

import org.apache.commons.math3.stat.descriptive.moment.Skewness; //导入依赖的package包/类
@operator (
		value = "skewness",
		can_be_const = false,
		type = IType.LIST,
		category = { IOperatorCategory.STATISTICAL },
		concept = { IConcept.STATISTIC, IConcept.CLUSTERING })
@doc (
		value = "returns skewness value computed from the operand list of values",
		special_cases = "if the length of the list is lower than 3, returns NaN",
		examples = { @example (value = "skewness ([1,2,3,4,5])", equals = "0.0") })
public static Double skewness(final IScope scope, final GamaList data) throws GamaRuntimeException {
	final Skewness sk = new Skewness();
	final double[] values = new double[data.length(scope)];
	for (int i = 0; i < values.length; i++) {
		values[i] = Cast.asFloat(scope, data.get(i));
	}
	return sk.evaluate(values);
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:19,代码来源:Stats.java

示例2: getStatisticalSpectrumDescriptor

import org.apache.commons.math3.stat.descriptive.moment.Skewness; //导入依赖的package包/类
private double[] getStatisticalSpectrumDescriptor(double[] dataRow) {
    int N = dataRow.length;
    double ssd[] = new double[N_STATISTICAL_DESCRIPTORS];

    ssd[0] = new Mean().evaluate(dataRow);
    ssd[1] = new Variance().evaluate(dataRow);
    ssd[2] = new Skewness().evaluate(dataRow);
    ssd[3] = new Kurtosis().evaluate(dataRow);

    // NOTE: be careful, sort changes data!
    // (as sonogram.getRow() above copies the data anyway, in this case there is no problem)
    // (otherwise, use dataRow.clone(); )
    Arrays.sort(dataRow);

    // median
    if (N % 2 == 0) {
        ssd[4] = (dataRow[(N / 2) - 1] + dataRow[(N / 2)]) / 2;
    } else {
        ssd[4] = dataRow[(N - 1) / 2];
    }

    ssd[5] = dataRow[0]; // min value
    ssd[6] = dataRow[N - 1]; // max value

    return ssd;
}
 
开发者ID:AntonioCollarino,项目名称:MusicFeatureExtractor,代码行数:27,代码来源:FeatureExtractor.java

示例3: agg

import org.apache.commons.math3.stat.descriptive.moment.Skewness; //导入依赖的package包/类
@Override
public double agg(double[] data) {
    return new Skewness().evaluate(data, 0, data.length);
}
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:5,代码来源:AggregateFunctions.java


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