本文整理汇总了Java中com.rapidminer.operator.ports.metadata.PassThroughOrGenerateRule类的典型用法代码示例。如果您正苦于以下问题:Java PassThroughOrGenerateRule类的具体用法?Java PassThroughOrGenerateRule怎么用?Java PassThroughOrGenerateRule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PassThroughOrGenerateRule类属于com.rapidminer.operator.ports.metadata包,在下文中一共展示了PassThroughOrGenerateRule类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ClusterNumberEvaluator
import com.rapidminer.operator.ports.metadata.PassThroughOrGenerateRule; //导入依赖的package包/类
/**
* Constructor for ClusterNumberEvaluator.
*/
public ClusterNumberEvaluator(OperatorDescription description) {
super(description);
performanceInput.addPrecondition(new SimplePrecondition(performanceInput, new MetaData(PerformanceVector.class),
false));
getTransformer().addRule(
new PassThroughOrGenerateRule(performanceInput, performanceOutput, new MetaData(PerformanceVector.class)));
getTransformer().addPassThroughRule(clusterModelInput, clusterModelOutput);
addValue(new ValueDouble("clusternumber", "The number of clusters.", false) {
@Override
public double getDoubleValue() {
return numberOfClusters;
}
});
}
示例2: ClusterDensityEvaluator
import com.rapidminer.operator.ports.metadata.PassThroughOrGenerateRule; //导入依赖的package包/类
/**
* Constructor for ClusterDensityEvaluator.
*/
public ClusterDensityEvaluator(OperatorDescription description) {
super(description);
exampleSetInput.addPrecondition(new ExampleSetPrecondition(exampleSetInput, Ontology.ATTRIBUTE_VALUE,
Attributes.ID_NAME));
getTransformer().addPassThroughRule(exampleSetInput, exampleSetOutput);
getTransformer().addRule(
new PassThroughOrGenerateRule(performanceInput, performanceOutput, new MetaData(PerformanceVector.class)));
addValue(new ValueDouble("clusterdensity", "Avg. within cluster similarity/distance", false) {
@Override
public double getDoubleValue() {
return avgClusterSim;
}
});
}
示例3: CentroidBasedEvaluator
import com.rapidminer.operator.ports.metadata.PassThroughOrGenerateRule; //导入依赖的package包/类
/**
* Constructor for ClusterDensityEvaluator.
*/
public CentroidBasedEvaluator(OperatorDescription description) {
super(description);
performanceInput.addPrecondition(new SimplePrecondition(performanceInput, new MetaData(PerformanceVector.class), false));
getTransformer().addRule(new PassThroughOrGenerateRule(performanceInput, performanceOutput, new MetaData(PerformanceVector.class)));
getTransformer().addPassThroughRule(exampleSetInput, exampleSetOutput);
getTransformer().addPassThroughRule(clusterModelInput, clusterModelOutput);
getTransformer().addRule(new GenerateNewMDRule(performanceOutput, PerformanceVector.class));
addValue(new ValueDouble(CRITERIA_LIST_SHORT[0], CRITERIA_LIST[0], false) {
@Override
public double getDoubleValue() {
return avgWithinClusterDistance;
}
});
addValue(new ValueDouble(CRITERIA_LIST_SHORT[1], CRITERIA_LIST[1], false) {
@Override
public double getDoubleValue() {
return daviesBouldin;
}
});
}
示例4: CentroidBasedEvaluator
import com.rapidminer.operator.ports.metadata.PassThroughOrGenerateRule; //导入依赖的package包/类
/**
* Constructor for ClusterDensityEvaluator.
*/
public CentroidBasedEvaluator(OperatorDescription description) {
super(description);
performanceInput.addPrecondition(new SimplePrecondition(performanceInput, new MetaData(PerformanceVector.class),
false));
getTransformer().addRule(
new PassThroughOrGenerateRule(performanceInput, performanceOutput, new MetaData(PerformanceVector.class)));
getTransformer().addPassThroughRule(exampleSetInput, exampleSetOutput);
getTransformer().addPassThroughRule(clusterModelInput, clusterModelOutput);
getTransformer().addRule(new GenerateNewMDRule(performanceOutput, PerformanceVector.class));
addValue(new ValueDouble(CRITERIA_LIST_SHORT[0], CRITERIA_LIST[0], false) {
@Override
public double getDoubleValue() {
return avgWithinClusterDistance;
}
});
addValue(new ValueDouble(CRITERIA_LIST_SHORT[1], CRITERIA_LIST[1], false) {
@Override
public double getDoubleValue() {
return daviesBouldin;
}
});
}
示例5: ExampleDistributionEvaluator
import com.rapidminer.operator.ports.metadata.PassThroughOrGenerateRule; //导入依赖的package包/类
public ExampleDistributionEvaluator(OperatorDescription description) {
super(description);
getTransformer().addPassThroughRule(clusterModelInput, clusterModelOutput);
getTransformer().addRule(
new PassThroughOrGenerateRule(performanceInput, performanceOutput, new MetaData(PerformanceVector.class)));
addValue(new ValueDouble("item_distribution", "The distribution of items over clusters.", false) {
@Override
public double getDoubleValue() {
return distribution;
}
});
}
示例6: ClusterNumberEvaluator
import com.rapidminer.operator.ports.metadata.PassThroughOrGenerateRule; //导入依赖的package包/类
/**
* Constructor for ClusterNumberEvaluator.
*/
public ClusterNumberEvaluator(OperatorDescription description) {
super(description);
performanceInput.addPrecondition(new SimplePrecondition(performanceInput, new MetaData(PerformanceVector.class), false));
getTransformer().addRule(new PassThroughOrGenerateRule(performanceInput, performanceOutput, new MetaData(PerformanceVector.class)));
getTransformer().addPassThroughRule(clusterModelInput, clusterModelOutput);
addValue(new ValueDouble("clusternumber", "The number of clusters.", false) {
@Override
public double getDoubleValue() {
return numberOfClusters;
}
});
}
示例7: ExampleDistributionEvaluator
import com.rapidminer.operator.ports.metadata.PassThroughOrGenerateRule; //导入依赖的package包/类
public ExampleDistributionEvaluator(OperatorDescription description) {
super(description);
getTransformer().addPassThroughRule(clusterModelInput, clusterModelOutput);
getTransformer().addRule(new PassThroughOrGenerateRule(performanceInput, performanceOutput, new MetaData(PerformanceVector.class)));
addValue(new ValueDouble("item_distribution", "The distribution of items over clusters.", false) {
@Override
public double getDoubleValue() {
return distribution;
}
});
}
示例8: ClusterDensityEvaluator
import com.rapidminer.operator.ports.metadata.PassThroughOrGenerateRule; //导入依赖的package包/类
/**
* Constructor for ClusterDensityEvaluator.
*/
public ClusterDensityEvaluator(OperatorDescription description) {
super(description);
exampleSetInput.addPrecondition(new ExampleSetPrecondition(exampleSetInput, Ontology.ATTRIBUTE_VALUE, Attributes.ID_NAME));
getTransformer().addPassThroughRule(exampleSetInput, exampleSetOutput);
getTransformer().addRule(new PassThroughOrGenerateRule(performanceInput, performanceOutput, new MetaData(PerformanceVector.class)));
addValue(new ValueDouble("clusterdensity", "Avg. within cluster similarity/distance", false) {
@Override
public double getDoubleValue() {
return avgClusterSim;
}
});
}
示例9: AbstractPerformanceEvaluator
import com.rapidminer.operator.ports.metadata.PassThroughOrGenerateRule; //导入依赖的package包/类
public AbstractPerformanceEvaluator(OperatorDescription description) {
super(description);
// exampleSetInput.addPrecondition(new ExampleSetPrecondition(exampleSetInput,
// Ontology.VALUE_TYPE, Attributes.LABEL_NAME,
// Attributes.PREDICTION_NAME));
exampleSetInput.addPrecondition(new CapabilityPrecondition(this, exampleSetInput));
exampleSetInput.addPrecondition(new SimplePrecondition(exampleSetInput, new ExampleSetMetaData()) {
@Override
public void makeAdditionalChecks(MetaData metaData) {
if (!(metaData instanceof ExampleSetMetaData)) {
exampleSetInput.addError(new MetaDataUnderspecifiedError(exampleSetInput));
return;
}
ExampleSetMetaData emd = (ExampleSetMetaData) metaData;
if (emd.hasSpecial(Attributes.LABEL_NAME) == MetaDataInfo.YES
&& emd.hasSpecial(Attributes.PREDICTION_NAME) == MetaDataInfo.YES) {
int type1 = emd.getSpecial(Attributes.LABEL_NAME).getValueType();
int type2 = emd.getSpecial(Attributes.PREDICTION_NAME).getValueType();
if (type1 != type2) {
exampleSetInput.addError(new SimpleMetaDataError(Severity.ERROR, exampleSetInput,
"label_prediction_mismatch", new Object[] { Ontology.ATTRIBUTE_VALUE_TYPE.mapIndex(type1),
Ontology.ATTRIBUTE_VALUE_TYPE.mapIndex(type2) }));
} else if (!canEvaluate(type1)) {
exampleSetInput.addError(new SimpleMetaDataError(Severity.ERROR, exampleSetInput,
"cannot_evaluate_label_type", new Object[] { Ontology.ATTRIBUTE_VALUE_TYPE.mapIndex(type1) }));
}
}
}
});
performanceInput.addPrecondition(new SimplePrecondition(performanceInput, new MetaData(PerformanceVector.class),
false));
PassThroughOrGenerateRule performanceRule = new PassThroughOrGenerateRule(performanceInput, performanceOutput,
new MetaData(PerformanceVector.class));
getTransformer().addRule(performanceRule);
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetOutput, false));
// add values for logging
List<PerformanceCriterion> criteria = getCriteria();
for (PerformanceCriterion criterion : criteria) {
addPerformanceValue(criterion.getName(), criterion.getDescription());
}
addValue(new ValueDouble("performance", "The last performance (main criterion).") {
@Override
public double getDoubleValue() {
if (currentPerformanceVector != null) {
return currentPerformanceVector.getMainCriterion().getAverage();
} else {
return Double.NaN;
}
}
});
}
示例10: AbstractPerformanceEvaluator
import com.rapidminer.operator.ports.metadata.PassThroughOrGenerateRule; //导入依赖的package包/类
public AbstractPerformanceEvaluator(OperatorDescription description) {
super(description);
// exampleSetInput.addPrecondition(new ExampleSetPrecondition(exampleSetInput,
// Ontology.VALUE_TYPE, Attributes.LABEL_NAME,
// Attributes.PREDICTION_NAME));
exampleSetInput.addPrecondition(new CapabilityPrecondition(this, exampleSetInput));
exampleSetInput.addPrecondition(new SimplePrecondition(exampleSetInput, new ExampleSetMetaData()) {
@Override
public void makeAdditionalChecks(MetaData metaData) {
if (!(metaData instanceof ExampleSetMetaData)) {
exampleSetInput.addError(new MetaDataUnderspecifiedError(exampleSetInput));
return;
}
ExampleSetMetaData emd = (ExampleSetMetaData) metaData;
if (emd.hasSpecial(Attributes.LABEL_NAME) == MetaDataInfo.YES
&& emd.hasSpecial(Attributes.PREDICTION_NAME) == MetaDataInfo.YES) {
int type1 = emd.getSpecial(Attributes.LABEL_NAME).getValueType();
int type2 = emd.getSpecial(Attributes.PREDICTION_NAME).getValueType();
if (type1 != type2) {
exampleSetInput.addError(new SimpleMetaDataError(Severity.ERROR, exampleSetInput,
"label_prediction_mismatch", new Object[] { Ontology.ATTRIBUTE_VALUE_TYPE.mapIndex(type1),
Ontology.ATTRIBUTE_VALUE_TYPE.mapIndex(type2) }));
} else if (!canEvaluate(type1)) {
exampleSetInput.addError(new SimpleMetaDataError(Severity.ERROR, exampleSetInput,
"cannot_evaluate_label_type", new Object[] { Ontology.ATTRIBUTE_VALUE_TYPE.mapIndex(type1) }));
}
}
}
});
performanceInput.addPrecondition(new SimplePrecondition(performanceInput, new MetaData(PerformanceVector.class),
false));
PassThroughOrGenerateRule performanceRule = new PassThroughOrGenerateRule(performanceInput, performanceOutput,
new MetaData(PerformanceVector.class));
getTransformer().addRule(performanceRule);
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetOutput, false));
// add values for logging
List<PerformanceCriterion> criteria = getCriteria();
for (PerformanceCriterion criterion : criteria) {
addPerformanceValue(criterion.getName(), criterion.getDescription());
}
addValue(new ValueDouble("performance", "The last performance (main criterion).") {
@Override
public double getDoubleValue() {
if (currentPerformanceVector != null) {
return currentPerformanceVector.getMainCriterion().getAverage();
} else {
return Double.NaN;
}
}
});
}
示例11: AbstractPerformanceEvaluator
import com.rapidminer.operator.ports.metadata.PassThroughOrGenerateRule; //导入依赖的package包/类
public AbstractPerformanceEvaluator(OperatorDescription description) {
super(description);
//exampleSetInput.addPrecondition(new ExampleSetPrecondition(exampleSetInput, Ontology.VALUE_TYPE, Attributes.LABEL_NAME, Attributes.PREDICTION_NAME));
exampleSetInput.addPrecondition(new CapabilityPrecondition(this, exampleSetInput));
exampleSetInput.addPrecondition(new SimplePrecondition(exampleSetInput, new ExampleSetMetaData()) {
@Override
public void makeAdditionalChecks(MetaData metaData) {
if (!(metaData instanceof ExampleSetMetaData)) {
exampleSetInput.addError(new MetaDataUnderspecifiedError(exampleSetInput));
return;
}
ExampleSetMetaData emd = (ExampleSetMetaData)metaData;
if ((emd.hasSpecial(Attributes.LABEL_NAME) == MetaDataInfo.YES) && (emd.hasSpecial(Attributes.PREDICTION_NAME) == MetaDataInfo.YES)) {
int type1 = emd.getSpecial(Attributes.LABEL_NAME).getValueType();
int type2 = emd.getSpecial(Attributes.PREDICTION_NAME).getValueType();
if (type1 != type2) {
exampleSetInput.addError(new SimpleMetaDataError(Severity.ERROR,
exampleSetInput,
"label_prediction_mismatch",
new Object[] { Ontology.ATTRIBUTE_VALUE_TYPE.mapIndex(type1), Ontology.ATTRIBUTE_VALUE_TYPE.mapIndex(type2) }));
} else if (!canEvaluate(type1)) {
exampleSetInput.addError(new SimpleMetaDataError(Severity.ERROR, exampleSetInput, "cannot_evaluate_label_type", new Object[] { Ontology.ATTRIBUTE_VALUE_TYPE.mapIndex(type1) }));
}
}
}
});
performanceInput.addPrecondition(new SimplePrecondition(performanceInput, new MetaData(PerformanceVector.class), false));
PassThroughOrGenerateRule performanceRule = new PassThroughOrGenerateRule(performanceInput, performanceOutput, new MetaData(PerformanceVector.class));
getTransformer().addRule(performanceRule);
getTransformer().addRule(new PassThroughRule(exampleSetInput, exampleSetOutput, false));
// add values for logging
List<PerformanceCriterion> criteria = getCriteria();
for (PerformanceCriterion criterion : criteria) {
addPerformanceValue(criterion.getName(), criterion.getDescription());
}
addValue(new ValueDouble("performance", "The last performance (main criterion).") {
@Override
public double getDoubleValue() {
if (currentPerformanceVector != null)
return currentPerformanceVector.getMainCriterion().getAverage();
else
return Double.NaN;
}
});
}