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


Java Tools.isLabelled方法代码示例

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


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

示例1: checkCompatibility

import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
protected void checkCompatibility(ExampleSet exampleSet) throws OperatorException {
	Tools.isLabelled(exampleSet);
	Tools.isNonEmpty(exampleSet);

	Attribute label = exampleSet.getAttributes().getLabel();
	if (!label.isNominal()) {
		throw new UserError(this, 101, "the calculation of performance criteria for binominal classification tasks",
				label.getName());
	}

	if (label.getMapping().size() != 2) {
		throw new UserError(this, 114, "the calculation of performance criteria for binominal classification tasks",
				label.getName());
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:17,代码来源:BinominalClassificationPerformanceEvaluator.java

示例2: checkCompatibility

import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
protected void checkCompatibility(ExampleSet exampleSet) throws OperatorException {
	Tools.isLabelled(exampleSet);
	Tools.isNonEmpty(exampleSet);

	Attribute label = exampleSet.getAttributes().getLabel();
	if (!label.isNumerical()) {
		throw new UserError(this, 102, "the calculation of performance criteria for regression tasks", label.getName());
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:11,代码来源:RegressionPerformanceEvaluator.java

示例3: checkCompatibility

import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
protected void checkCompatibility(ExampleSet exampleSet) throws OperatorException {
	Tools.isLabelled(exampleSet);
	Tools.isNonEmpty(exampleSet);

	Attribute label = exampleSet.getAttributes().getLabel();
	if (!label.isNominal()) {
		throw new UserError(this, 101, "the calculation of performance criteria for classification tasks",
				label.getName());
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:12,代码来源:PolynominalClassificationPerformanceEvaluator.java

示例4: getRanges

import com.rapidminer.example.Tools; //导入方法依赖的package包/类
/**
 * Delivers the maximum range thresholds for all attributes, i.e. the value getRanges()[a][b] is
 * the b-th threshold for the a-th attribute.
 *
 * @throws UserError
 *             is label is missing
 */
private double[][] getRanges(ExampleSet exampleSet) throws UserError {
	Tools.isLabelled(exampleSet);
	Attributes attributes = exampleSet.getAttributes();
	double[][] ranges = new double[attributes.size()][];
	Attribute label = attributes.getLabel();

	int a = 0;
	for (Attribute attribute : attributes) {
		if (attribute.isNumerical()) { // skip nominal and date attributes
			Iterator<Example> reader = exampleSet.iterator();
			LinkedList<double[]> startPartition = new LinkedList<double[]>();
			while (reader.hasNext()) { // Create start partition.
				Example example = reader.next();
				double[] attributeLabelPair = new double[2];
				attributeLabelPair[0] = example.getValue(attribute);
				attributeLabelPair[1] = example.getValue(label);
				startPartition.addLast(attributeLabelPair);
			}
			ArrayList<Double> splitpointsOfAttribute = getSplitpoints(startPartition, label);
			Iterator<Double> it = splitpointsOfAttribute.iterator();
			ranges[a] = new double[splitpointsOfAttribute.size() + 1];
			for (int i = 0; it.hasNext(); i++) {
				ranges[a][i] = it.next();
			}
			ranges[a][ranges[a].length - 1] = exampleSet.getStatistics(attribute, Statistics.MAXIMUM);
			Arrays.sort(ranges[a]);
		}
		a++;
	}
	return ranges;
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:39,代码来源:MinimalEntropyDiscretization.java

示例5: checkCompatibility

import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
protected void checkCompatibility(ExampleSet exampleSet) throws OperatorException {
	Tools.isLabelled(exampleSet);
	Tools.isNonEmpty(exampleSet);
	
	Attribute label = exampleSet.getAttributes().getLabel();
	if (!label.isNumerical()) {
		throw new UserError(this, 102, "the calculation of performance criteria for regression tasks", label.getName());
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:11,代码来源:RegressionPerformanceEvaluator.java

示例6: checkCompatibility

import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
protected void checkCompatibility(ExampleSet exampleSet) throws OperatorException {
	Tools.isLabelled(exampleSet);
	Tools.isNonEmpty(exampleSet);

	Attribute label = exampleSet.getAttributes().getLabel();
	if (!label.isNominal()) {
		throw new UserError(this, 101, "the calculation of performance criteria for classification tasks", label.getName());
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:11,代码来源:PolynominalClassificationPerformanceEvaluator.java

示例7: checkCompatibility

import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
protected void checkCompatibility(ExampleSet exampleSet) throws OperatorException {
	Tools.isLabelled(exampleSet);
	Tools.isNonEmpty(exampleSet);
	
	Attribute label = exampleSet.getAttributes().getLabel();
	if (!label.isNominal()) {
		throw new UserError(this, 101, "the calculation of performance criteria for binominal classification tasks", label.getName());
	}
	
	if (label.getMapping().size() != 2) {
		throw new UserError(this, 114, "the calculation of performance criteria for binominal classification tasks", label.getName());
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:15,代码来源:BinominalClassificationPerformanceEvaluator.java


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