本文整理汇总了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());
}
}
示例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());
}
}
示例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());
}
}
示例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;
}
示例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());
}
}
示例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());
}
}
示例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());
}
}