本文整理汇总了Java中com.rapidminer.example.Tools.isNonEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java Tools.isNonEmpty方法的具体用法?Java Tools.isNonEmpty怎么用?Java Tools.isNonEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rapidminer.example.Tools
的用法示例。
在下文中一共展示了Tools.isNonEmpty方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doWork
import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
public void doWork() throws OperatorException {
ExampleSet es = exampleSetInput.getData(ExampleSet.class);
int dimensions = getParameterAsInt(PARAMETER_DIMENSIONS);
Tools.onlyNumericalAttributes(es, "dimensionality reduction");
Tools.isNonEmpty(es);
Tools.checkAndCreateIds(es);
double[][] p = dimensionalityReduction(es, dimensions);
DimensionalityReducerModel model = new DimensionalityReducerModel(es, p, dimensions);
if (exampleSetOutput.isConnected()) {
exampleSetOutput.deliver(model.apply((ExampleSet) es.clone()));
}
originalOutput.deliver(es);
modelOutput.deliver(model);
}
示例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.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());
}
}
示例3: generateInternalClusterModel
import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
protected ClusterModel generateInternalClusterModel(ExampleSet exampleSet) throws OperatorException {
// get parameters
int k = getParameterAsInt(PARAMETER_K);
// perform checks
Tools.isNonEmpty(exampleSet);
Tools.onlyNonMissingValues(exampleSet, getOperatorClassName(), this, new String[0]);
Tools.checkAndCreateIds(exampleSet);
if (exampleSet.size() < k) {
logWarning("number of clusters (k) = " + k + " > number of objects =" + exampleSet.size());
throw new UserError(this, 142, k);
}
ClusterModel model = createClusterModel(exampleSet);
return model;
}
示例4: doWork
import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
public void doWork() throws OperatorException {
ExampleSet es = exampleSetInput.getData(ExampleSet.class);
int dimensions = getParameterAsInt(PARAMETER_DIMENSIONS);
Tools.onlyNumericalAttributes(es, "dimensionality reduction");
Tools.isNonEmpty(es);
Tools.checkAndCreateIds(es);
double[][] p = dimensionalityReduction(es, dimensions);
DimensionalityReducerModel model = new DimensionalityReducerModel(es, p, dimensions);
if (exampleSetOutput.isConnected())
exampleSetOutput.deliver(model.apply((ExampleSet)es.clone()));
originalOutput.deliver(es);
modelOutput.deliver(model);
}
示例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.isNonEmpty(exampleSet);
Tools.hasNominalLabels(exampleSet, "the calculation of performance criteria for binominal classification tasks");
Attribute label = exampleSet.getAttributes().getLabel();
if (label.getMapping().size() != 2) {
throw new UserError(this, 114, "the calculation of performance criteria for binominal classification tasks",
label.getName());
}
}
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:12,代码来源:BinominalClassificationPerformanceEvaluator.java
示例8: apply
import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
public ExampleSet apply(ExampleSet exampleSet) throws OperatorException {
// cannot bootstrap without any examples
Tools.isNonEmpty(exampleSet);
int size = exampleSet.size();
RandomGenerator random = RandomGenerator.getRandomGenerator(this);
switch (getParameterAsInt(PARAMETER_SAMPLE)) {
case SAMPLE_ABSOLUTE:
size = getParameterAsInt(PARAMETER_SAMPLE_SIZE);
break;
case SAMPLE_RELATIVE:
size = (int) Math.round(exampleSet.size() * getParameterAsDouble(PARAMETER_SAMPLE_RATIO));
break;
}
int[] mapping = null;
if (getParameterAsBoolean(PARAMETER_USE_WEIGHTS) && exampleSet.getAttributes().getWeight() != null) {
mapping = MappedExampleSet.createWeightedBootstrappingMapping(exampleSet, size, random);
} else {
mapping = MappedExampleSet.createBootstrappingMapping(exampleSet, size, random);
}
// create and materialize example set
ExampleSet mappedExampleSet = new MappedExampleSet(exampleSet, mapping, true);
if (getCompatibilityLevel().isAbove(VERSION_6_4_0)) {
int type = DataRowFactory.TYPE_DOUBLE_ARRAY;
if (exampleSet.size() > 0) {
type = exampleSet.getExampleTable().getDataRow(0).getType();
}
mappedExampleSet = MaterializeDataInMemory.materializeExampleSet(mappedExampleSet, type);
}
return mappedExampleSet;
}
示例9: createExampleSet
import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
public ExampleSet createExampleSet() throws OperatorException {
int datamanagement = getParameterAsInt(PARAMETER_DATAMANAGEMENT);
if (!Boolean.parseBoolean(ParameterService.getParameterValue(RapidMiner.PROPERTY_RAPIDMINER_SYSTEM_LEGACY_DATA_MGMT))) {
datamanagement = DataRowFactory.TYPE_DOUBLE_ARRAY;
}
DataRowFactory dataRowFactory = new DataRowFactory(datamanagement, '.');
ExampleSet result = null;
// read file and construct example set
try {
InputStream inputStream = filePortHandler.openSelectedFile();
result = readStream(inputStream, dataRowFactory);
inputStream.close();
} catch (IOException e) {
throw new UserError(this, e, 302, filePortHandler.getSelectedFileDescription(), e.getMessage());
}
// verify that the result is not null
if (result == null) {
throw new UserError(this, 302, filePortHandler.getSelectedFileDescription(), UNSPECIFIED_ERROR_MESSAGE);
}
// verify that the resulting example set is not empty
Tools.isNonEmpty(result);
return result;
}
示例10: 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());
}
}
示例11: 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());
}
}
示例12: 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());
}
}
示例13: checkCompatibility
import com.rapidminer.example.Tools; //导入方法依赖的package包/类
@Override
protected void checkCompatibility(ExampleSet exampleSet) throws OperatorException {
Tools.isNonEmpty(exampleSet);
Tools.hasNominalLabels(exampleSet, "the calculation of performance criteria for classification tasks");
}
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:6,代码来源:PolynominalClassificationPerformanceEvaluator.java