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


Java SignificanceTestResult.getProbability方法代码示例

本文整理汇总了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());
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:20,代码来源:AnovaSignificanceTestOperator.java

示例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());
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:19,代码来源:AnovaSignificanceTestOperator.java

示例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));
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:48,代码来源:ANOVAMatrixOperator.java

示例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));		
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:46,代码来源:ANOVAMatrixOperator.java


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