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


Java MathFunctions.correlation方法代码示例

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


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

示例1: calculateWeights

import com.rapidminer.tools.math.MathFunctions; //导入方法依赖的package包/类
@Override
public AttributeWeights calculateWeights(ExampleSet exampleSet) throws OperatorException {
	Attributes attributes = exampleSet.getAttributes();
	Attribute labelAttribute = attributes.getLabel();
	boolean useSquaredCorrelation = getParameterAsBoolean(PARAMETER_SQUARED_CORRELATION);

	AttributeWeights weights = new AttributeWeights(exampleSet);
	getProgress().setTotal(attributes.size());
	int progressCounter = 0;
	int exampleSetSize = exampleSet.size();
	int exampleCounter = 0;
	for (Attribute attribute : attributes) {
		double correlation = MathFunctions.correlation(exampleSet, labelAttribute, attribute, useSquaredCorrelation);
		weights.setWeight(attribute.getName(), Math.abs(correlation));
		progressCounter++;
		exampleCounter += exampleSetSize;
		if(exampleCounter > PROGRESS_UPDATE_STEPS) {
			exampleCounter = 0;
			getProgress().setCompleted(progressCounter);
		}
	}

	return weights;
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:25,代码来源:CorrelationWeighting.java

示例2: calculateWeights

import com.rapidminer.tools.math.MathFunctions; //导入方法依赖的package包/类
@Override
public AttributeWeights calculateWeights(ExampleSet exampleSet) throws OperatorException {
	Attributes attributes = exampleSet.getAttributes();
	Attribute labelAttribute = attributes.getLabel();
	boolean useSquaredCorrelation = getParameterAsBoolean(PARAMETER_SQUARED_CORRELATION);

	AttributeWeights weights = new AttributeWeights(exampleSet);
	for (Attribute attribute : attributes) {
		double correlation = MathFunctions.correlation(exampleSet, labelAttribute, attribute, useSquaredCorrelation);
		weights.setWeight(attribute.getName(), Math.abs(correlation));
	}

	return weights;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:15,代码来源:CorrelationWeighting.java

示例3: getCorrelation

import com.rapidminer.tools.math.MathFunctions; //导入方法依赖的package包/类
double getCorrelation(ExampleSet exampleSet, boolean[] selectedAttributes, double[] coefficients, boolean useIntercept) {
	double[] labelValues = new double[exampleSet.size()];
	double[] predictions = new double[exampleSet.size()];
	int index = 0;
	for (Example e : exampleSet) {
		labelValues[index] = e.getLabel();
		predictions[index] = regressionPrediction(e, selectedAttributes, coefficients, useIntercept);
		index++;
	}
	return MathFunctions.correlation(labelValues, predictions);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:12,代码来源:LinearRegression.java

示例4: calculateWeights

import com.rapidminer.tools.math.MathFunctions; //导入方法依赖的package包/类
@Override
public AttributeWeights calculateWeights(ExampleSet exampleSet) throws OperatorException {
	Attributes attributes = exampleSet.getAttributes();
	Attribute labelAttribute = attributes.getLabel();
	boolean useSquaredCorrelation = getParameterAsBoolean(PARAMETER_SQUARED_CORRELATION);

	AttributeWeights weights = new AttributeWeights(exampleSet);
	for (Attribute attribute: attributes) {
		double correlation = MathFunctions.correlation(exampleSet, labelAttribute, attribute, useSquaredCorrelation);
		weights.setWeight(attribute.getName(), Math.abs(correlation));
	}

	return weights;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:15,代码来源:CorrelationWeighting.java

示例5: getCorrelation

import com.rapidminer.tools.math.MathFunctions; //导入方法依赖的package包/类
double getCorrelation(ExampleSet exampleSet, boolean[] selectedAttributes, double[] coefficients, boolean useIntercept) {
    double[] labelValues = new double[exampleSet.size()];
    double[] predictions = new double[exampleSet.size()];
    int index = 0;
    for (Example e : exampleSet) {
        labelValues[index] = e.getLabel();
        predictions[index] = regressionPrediction(e, selectedAttributes, coefficients, useIntercept);
        index++;
    }
    return MathFunctions.correlation(labelValues, predictions);
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:12,代码来源:LinearRegression.java

示例6: calculateSimilarity

import com.rapidminer.tools.math.MathFunctions; //导入方法依赖的package包/类
@Override
public double calculateSimilarity(double[] value1, double[] value2) {
	return MathFunctions.correlation(value1, value2);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:5,代码来源:CorrelationSimilarity.java


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