本文整理汇总了Java中com.rapidminer.tools.math.SignificanceTestResult.getProbability方法的典型用法代码示例。如果您正苦于以下问题:Java SignificanceTestResult.getProbability方法的具体用法?Java SignificanceTestResult.getProbability怎么用?Java SignificanceTestResult.getProbability使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rapidminer.tools.math.SignificanceTestResult
的用法示例。
在下文中一共展示了SignificanceTestResult.getProbability方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performSignificanceTest
import com.rapidminer.tools.math.SignificanceTestResult; //导入方法依赖的package包/类
@Override
public SignificanceTestResult performSignificanceTest(PerformanceVector[] allVectors, double alpha)
throws OperatorException {
AnovaCalculator calculator = new AnovaCalculator();
calculator.setAlpha(alpha);
for (int i = 0; i < allVectors.length; i++) {
PerformanceCriterion pc = allVectors[i].getMainCriterion();
calculator.addGroup(pc.getAverageCount(), pc.getAverage(), pc.getVariance());
}
try {
SignificanceTestResult testResult = calculator.performSignificanceTest();
this.probability = testResult.getProbability();
return testResult;
} catch (SignificanceCalculationException e) {
throw new UserError(this, 920, e.getMessage());
}
}
示例2: performSignificanceTest
import com.rapidminer.tools.math.SignificanceTestResult; //导入方法依赖的package包/类
@Override
public SignificanceTestResult performSignificanceTest(PerformanceVector[] allVectors, double alpha) throws OperatorException {
AnovaCalculator calculator = new AnovaCalculator();
calculator.setAlpha(alpha);
for (int i = 0; i < allVectors.length; i++) {
PerformanceCriterion pc = allVectors[i].getMainCriterion();
calculator.addGroup(pc.getAverageCount(), pc.getAverage(), pc.getVariance());
}
try {
SignificanceTestResult testResult = calculator.performSignificanceTest();
this.probability = testResult.getProbability();
return testResult;
} catch (SignificanceCalculationException e) {
throw new UserError(this, 920, e.getMessage());
}
}
示例3: doWork
import com.rapidminer.tools.math.SignificanceTestResult; //导入方法依赖的package包/类
@Override
public void doWork() throws OperatorException {
ExampleSet inputSet = exampleSetInput.getData(ExampleSet.class);
ExampleSet exampleSet = new NonSpecialAttributesExampleSet(inputSet);
// determine anova and grouping attributes
List<String> nominalAttributes = new ArrayList<String>();
List<String> numericalAttributes = new ArrayList<String>();
Iterator<Attribute> a = exampleSet.getAttributes().allAttributes();
while (a.hasNext()) {
Attribute attribute = a.next();
if (attribute.isNominal()) {
nominalAttributes.add(attribute.getName());
} else if (attribute.isNumerical()) {
numericalAttributes.add(attribute.getName());
}
}
// init "inner" operator
GroupedANOVAOperator groupedAnovaOperator = null;
try {
groupedAnovaOperator = OperatorService.createOperator(GroupedANOVAOperator.class);
} catch (OperatorCreationException e) {
throw new UserError(this, 109, GroupedANOVAOperator.class.getName());
}
double significanceLevel = getParameterAsDouble(GroupedANOVAOperator.PARAMETER_SIGNIFICANCE_LEVEL);
groupedAnovaOperator.setParameter(GroupedANOVAOperator.PARAMETER_SIGNIFICANCE_LEVEL, significanceLevel + "");
groupedAnovaOperator.setParameter(GroupedANOVAOperator.PARAMETER_ONLY_DISTINCT,
getParameterAsBoolean(GroupedANOVAOperator.PARAMETER_ONLY_DISTINCT) + "");
// calculate all values
double[][] probabilities = new double[numericalAttributes.size()][nominalAttributes.size()];
for (int numericalCounter = 0; numericalCounter < probabilities.length; numericalCounter++) {
String numericalAttributeName = numericalAttributes.get(numericalCounter);
for (int nominalCounter = 0; nominalCounter < probabilities[numericalCounter].length; nominalCounter++) {
String nominalAttributeName = nominalAttributes.get(nominalCounter);
groupedAnovaOperator.setParameter(GroupedANOVAOperator.PARAMETER_ANOVA_ATTRIBUTE, numericalAttributeName);
groupedAnovaOperator.setParameter(GroupedANOVAOperator.PARAMETER_GROUP_BY_ATTRIBUTE, nominalAttributeName);
SignificanceTestResult testResult = groupedAnovaOperator.apply((ExampleSet) exampleSet.clone());
probabilities[numericalCounter][nominalCounter] = testResult.getProbability();
}
}
// create and return result
exampleSetOutput.deliver(exampleSet);
anovaOutput.deliver(new ANOVAMatrix(probabilities, numericalAttributes, nominalAttributes, significanceLevel));
}
示例4: doWork
import com.rapidminer.tools.math.SignificanceTestResult; //导入方法依赖的package包/类
@Override
public void doWork() throws OperatorException {
ExampleSet inputSet = exampleSetInput.getData(ExampleSet.class);
ExampleSet exampleSet = new NonSpecialAttributesExampleSet(inputSet);
// determine anova and grouping attributes
List<String> nominalAttributes = new ArrayList<String>();
List<String> numericalAttributes = new ArrayList<String>();
Iterator<Attribute> a = exampleSet.getAttributes().allAttributes();
while (a.hasNext()) {
Attribute attribute = a.next();
if (attribute.isNominal())
nominalAttributes.add(attribute.getName());
else if (attribute.isNumerical())
numericalAttributes.add(attribute.getName());
}
// init "inner" operator
GroupedANOVAOperator groupedAnovaOperator = null;
try {
groupedAnovaOperator = OperatorService.createOperator(GroupedANOVAOperator.class);
} catch (OperatorCreationException e) {
throw new UserError(this, 109, GroupedANOVAOperator.class.getName());
}
double significanceLevel = getParameterAsDouble(GroupedANOVAOperator.PARAMETER_SIGNIFICANCE_LEVEL);
groupedAnovaOperator.setParameter(GroupedANOVAOperator.PARAMETER_SIGNIFICANCE_LEVEL, significanceLevel + "");
groupedAnovaOperator.setParameter(GroupedANOVAOperator.PARAMETER_ONLY_DISTINCT, getParameterAsBoolean(GroupedANOVAOperator.PARAMETER_ONLY_DISTINCT) + "");
// calculate all values
double[][] probabilities = new double[numericalAttributes.size()][nominalAttributes.size()];
for (int numericalCounter = 0; numericalCounter < probabilities.length; numericalCounter++) {
String numericalAttributeName = numericalAttributes.get(numericalCounter);
for (int nominalCounter = 0; nominalCounter < probabilities[numericalCounter].length; nominalCounter++) {
String nominalAttributeName = nominalAttributes.get(nominalCounter);
groupedAnovaOperator.setParameter(GroupedANOVAOperator.PARAMETER_ANOVA_ATTRIBUTE, numericalAttributeName);
groupedAnovaOperator.setParameter(GroupedANOVAOperator.PARAMETER_GROUP_BY_ATTRIBUTE, nominalAttributeName);
SignificanceTestResult testResult = groupedAnovaOperator.apply((ExampleSet)exampleSet.clone());
probabilities[numericalCounter][nominalCounter] = testResult.getProbability();
}
}
// create and return result
exampleSetOutput.deliver(exampleSet);
anovaOutput.deliver(new ANOVAMatrix(probabilities, numericalAttributes, nominalAttributes, significanceLevel));
}