本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例6: calculateSimilarity
import com.rapidminer.tools.math.MathFunctions; //导入方法依赖的package包/类
@Override
public double calculateSimilarity(double[] value1, double[] value2) {
return MathFunctions.correlation(value1, value2);
}