本文整理汇总了Java中com.rapidminer.operator.ports.metadata.PassThroughRule类的典型用法代码示例。如果您正苦于以下问题:Java PassThroughRule类的具体用法?Java PassThroughRule怎么用?Java PassThroughRule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PassThroughRule类属于com.rapidminer.operator.ports.metadata包,在下文中一共展示了PassThroughRule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PartialExampleSetLearner
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public PartialExampleSetLearner(OperatorDescription description) {
super(description, "Learning Process");
exampleSetInput.addPrecondition(new ExampleSetPrecondition(exampleSetInput, new String[0], Ontology.VALUE_TYPE,
Attributes.LABEL_NAME));
getTransformer().addRule(
new ExampleSetPassThroughRule(exampleSetInput, exampleSubsetInnerSource, SetRelation.EQUAL) {
@Override
public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) throws UndefinedParameterError {
metaData.getNumberOfExamples().multiply(getParameterAsDouble(PARAMETER_FRACTION));
return super.modifyExampleSet(metaData);
}
});
getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
getTransformer().addRule(new PassThroughRule(modelInnerSink, modelOutput, false));
}
示例2: AbstractExampleSetProcessing
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public AbstractExampleSetProcessing(OperatorDescription description) {
super(description);
exampleSetInput.addPrecondition(new SimplePrecondition(exampleSetInput, getRequiredMetaData()));
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetOutput, false) {
@Override
public MetaData modifyMetaData(MetaData metaData) {
if (metaData instanceof ExampleSetMetaData) {
try {
return AbstractExampleSetProcessing.this.modifyMetaData((ExampleSetMetaData) metaData);
} catch (UndefinedParameterError e) {
return metaData;
}
} else {
return metaData;
}
}
});
getTransformer().addPassThroughRule(exampleSetInput, originalOutput);
}
示例3: TopDownClustering
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public TopDownClustering(OperatorDescription description) {
super(description, "Clustering Process");
exampleSetInput.addPrecondition(new SimplePrecondition(exampleSetInput, new ExampleSetMetaData()));
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetInnerSource, false));
getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
modelInnerSink.addPrecondition(new SimplePrecondition(modelInnerSink, new MetaData(ClusterModel.class)));
getTransformer().addRule(new ExampleSetPassThroughRule(exampleSetInput, exampleSetOutput, SetRelation.EQUAL) {
@Override
public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) {
if (addsClusterAttribute()) {
metaData.addAttribute(new AttributeMetaData(Attributes.CLUSTER_NAME, Ontology.NOMINAL,
Attributes.CLUSTER_NAME));
}
MetaDataTools.checkAndCreateIds(metaData);
return metaData;
}
});
getTransformer().addRule(new GenerateNewMDRule(modelOutput, new MetaData(HierarchicalClusterModel.class)));
}
示例4: DimensionalityReducer
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public DimensionalityReducer(OperatorDescription description) {
super(description);
exampleSetInput.addPrecondition(new CapabilityPrecondition(this, exampleSetInput));
getTransformer().addRule(new ExampleSetPassThroughRule(exampleSetInput, exampleSetOutput, SetRelation.SUBSET) {
@Override
public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) throws UndefinedParameterError {
metaData.clearRegular();
int numberOfDimensinos = getParameterAsInt(PARAMETER_DIMENSIONS);
for (int i = 0; i < numberOfDimensinos; i++) {
metaData.addAttribute(new AttributeMetaData("d" + i, Ontology.REAL));
}
return metaData;
}
});
getTransformer().addRule(new GenerateNewMDRule(modelOutput, Model.class));
getTransformer().addRule(new PassThroughRule(exampleSetInput, originalOutput, false));
}
示例5: ANOVAMatrixOperator
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public ANOVAMatrixOperator(OperatorDescription description) {
super(description);
exampleSetInput.addPrecondition(new ExampleSetPrecondition(exampleSetInput) {
@Override
public void makeAdditionalChecks(ExampleSetMetaData emd) throws UndefinedParameterError {
int numberOfNominals = 0;
for (AttributeMetaData amd : emd.getAllAttributes()) {
if (amd.isNominal()) {
numberOfNominals++;
}
}
if (numberOfNominals == 0) {
createError(Severity.WARNING, "exampleset.must_contain_nominal_attribute");
}
}
});
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetOutput, false));
getTransformer().addRule(new GenerateNewMDRule(anovaOutput, ANOVAMatrix.class));
}
示例6: TopDownClustering
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public TopDownClustering(OperatorDescription description) {
super(description, "Clustering Process");
exampleSetInput.addPrecondition(new SimplePrecondition(exampleSetInput, new ExampleSetMetaData()));
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetInnerSource, false));
getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
modelInnerSink.addPrecondition(new SimplePrecondition(modelInnerSink, new MetaData(ClusterModel.class)));
getTransformer().addRule(new ExampleSetPassThroughRule(exampleSetInput, exampleSetOutput, SetRelation.EQUAL) {
@Override
public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) {
if (addsClusterAttribute()) {
metaData.addAttribute(
new AttributeMetaData(Attributes.CLUSTER_NAME, Ontology.NOMINAL, Attributes.CLUSTER_NAME));
}
MetaDataTools.checkAndCreateIds(metaData);
return metaData;
}
});
getTransformer().addRule(new GenerateNewMDRule(modelOutput, new MetaData(HierarchicalClusterModel.class)));
}
示例7: RemoveDuplicates
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public RemoveDuplicates(OperatorDescription description) {
super(description);
// add metadata to the duplicate output
getTransformer().addRule(new PassThroughRule(getExampleSetInputPort(), duplicateSetOutput, false) {
@Override
public MetaData modifyMetaData(MetaData metaData) {
if (metaData instanceof ExampleSetMetaData) {
try {
return RemoveDuplicates.this.modifyMetaData((ExampleSetMetaData) metaData);
} catch (UndefinedParameterError e) {
return metaData;
}
} else {
return metaData;
}
}
});
}
示例8: AbstractExampleSetProcessing
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public AbstractExampleSetProcessing(OperatorDescription description) {
super(description);
exampleSetInput.addPrecondition(new SimplePrecondition(exampleSetInput, getRequiredMetaData()));
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetOutput, false) {
@Override
public MetaData modifyMetaData(MetaData metaData) {
if (metaData instanceof ExampleSetMetaData) {
try {
return AbstractExampleSetProcessing.this.modifyMetaData((ExampleSetMetaData) metaData);
} catch (UndefinedParameterError e) {
return metaData;
}
} else {
return metaData;
}
}
});
getTransformer().addPassThroughRule(exampleSetInput, originalOutput);
}
示例9: TopDownClustering
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public TopDownClustering(OperatorDescription description) {
super(description, "Clustering Process");
exampleSetInput.addPrecondition(new SimplePrecondition(exampleSetInput, new ExampleSetMetaData()));
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetInnerSource, false));
getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
modelInnerSink.addPrecondition(new SimplePrecondition(modelInnerSink, new MetaData(ClusterModel.class)));
getTransformer().addRule(new ExampleSetPassThroughRule(exampleSetInput, exampleSetOutput, SetRelation.EQUAL) {
@Override
public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) {
if (addsClusterAttribute()) {
metaData.addAttribute(new AttributeMetaData(Attributes.CLUSTER_NAME, Ontology.NOMINAL, Attributes.CLUSTER_NAME));
}
MetaDataTools.checkAndCreateIds(metaData);
return metaData;
}
});
getTransformer().addRule(new GenerateNewMDRule(modelOutput, new MetaData(HierarchicalClusterModel.class)));
}
示例10: DimensionalityReducer
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public DimensionalityReducer(OperatorDescription description) {
super(description);
exampleSetInput.addPrecondition(new CapabilityPrecondition(this, exampleSetInput));
getTransformer().addRule(new ExampleSetPassThroughRule(exampleSetInput, exampleSetOutput, SetRelation.SUBSET) {
@Override
public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) throws UndefinedParameterError {
metaData.clearRegular();
int numberOfDimensinos = getParameterAsInt(PARAMETER_DIMENSIONS);
for (int i = 0; i < numberOfDimensinos; i++) {
metaData.addAttribute(new AttributeMetaData("d" + i, Ontology.REAL));
}
return metaData;
}
});
getTransformer().addRule(new GenerateNewMDRule(modelOutput, Model.class));
getTransformer().addRule(new PassThroughRule(exampleSetInput, originalOutput, false));
}
示例11: ANOVAMatrixOperator
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public ANOVAMatrixOperator(OperatorDescription description) {
super(description);
exampleSetInput.addPrecondition(new ExampleSetPrecondition(exampleSetInput) {
@Override
public void makeAdditionalChecks(ExampleSetMetaData emd) throws UndefinedParameterError {
int numberOfNominals = 0;
for (AttributeMetaData amd: emd.getAllAttributes()) {
if (amd.isNominal())
numberOfNominals++;
}
if (numberOfNominals == 0) {
createError(Severity.WARNING, "exampleset.must_contain_nominal_attribute");
}
}
});
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetOutput, false));
getTransformer().addRule(new GenerateNewMDRule(anovaOutput, ANOVAMatrix.class));
}
示例12: ModelApplier
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public ModelApplier(OperatorDescription description) {
super(description);
modelInput.addPrecondition(new SimplePrecondition(modelInput, new ModelMetaData(Model.class,
new ExampleSetMetaData())));
exampleSetInput.addPrecondition(new SimplePrecondition(exampleSetInput, new ExampleSetMetaData()));
getTransformer().addRule(new ModelApplicationRule(exampleSetInput, exampleSetOutput, modelInput, false));
getTransformer().addRule(new PassThroughRule(modelInput, modelOutput, false));
}
示例13: FeatureIterator
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public FeatureIterator(OperatorDescription description) {
super(description, "Subprocess");
exampleSetInnerSink.addPrecondition(new SimplePrecondition(exampleSetInnerSink, new ExampleSetMetaData(), false));
innerSinkExtender = new CollectingPortPairExtender("result", getSubprocess(0).getInnerSinks(), getOutputPorts());
innerSinkExtender.start();
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetInnerSource, false));
getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
getTransformer().addRule(innerSinkExtender.makePassThroughRule());
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetOutput, false) {
@Override
public MetaData modifyMetaData(MetaData unmodifiedMetaData) {
if (exampleSetInnerSink.isConnected()) {
return exampleSetInnerSink.getMetaData();
} else {
// due to side effects, we cannot make any guarantee about the output.
return new ExampleSetMetaData();
}
}
});
addValue(new ValueDouble("iteration", "The number of the current iteration / loop.") {
@Override
public double getDoubleValue() {
return iteration;
}
});
addValue(new ValueString("feature_name", "The number of the current feature.") {
@Override
public String getStringValue() {
return currentName;
}
});
}
示例14: ExampleIterator
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public ExampleIterator(OperatorDescription description) {
super(description, "Example Process");
outExtender.start();
getTransformer().addPassThroughRule(exampleSetInput, exampleSetInnerSource);
getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetOutput, false) {
@Override
public MetaData modifyMetaData(MetaData unmodifiedMetaData) {
if (exampleSetInnerSink.isConnected()) {
return exampleSetInnerSink.getMetaData();
} else {
// due to side effects, we cannot make any guarantee about the output.
return new ExampleSetMetaData();
}
}
});
getTransformer().addRule(outExtender.makePassThroughRule());
addValue(new ValueDouble("iteration", "The number of the current iteration / loop / example.") {
@Override
public double getDoubleValue() {
return iteration;
}
});
}
示例15: BatchProcessing
import com.rapidminer.operator.ports.metadata.PassThroughRule; //导入依赖的package包/类
public BatchProcessing(OperatorDescription description) {
super(description, "Batch Process");
getTransformer().addRule(new ExampleSetPassThroughRule(exampleSetInput, exampleSetInnerSource, SetRelation.EQUAL) {
@Override
public ExampleSetMetaData modifyExampleSet(ExampleSetMetaData metaData) throws UndefinedParameterError {
metaData.setNumberOfExamples(getParameterAsInt(PARAMETER_BATCH_SIZE));
return super.modifyExampleSet(metaData);
}
});
getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetOutput, false));
}