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


Java MetaDataUnderspecifiedError类代码示例

本文整理汇总了Java中com.rapidminer.operator.ports.metadata.MetaDataUnderspecifiedError的典型用法代码示例。如果您正苦于以下问题:Java MetaDataUnderspecifiedError类的具体用法?Java MetaDataUnderspecifiedError怎么用?Java MetaDataUnderspecifiedError使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MetaDataUnderspecifiedError类属于com.rapidminer.operator.ports.metadata包,在下文中一共展示了MetaDataUnderspecifiedError类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AbstractPerformanceEvaluator

import com.rapidminer.operator.ports.metadata.MetaDataUnderspecifiedError; //导入依赖的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;
			}
		}
	});
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:57,代码来源:AbstractPerformanceEvaluator.java

示例2: AbstractPerformanceEvaluator

import com.rapidminer.operator.ports.metadata.MetaDataUnderspecifiedError; //导入依赖的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;
			}
		}
	});
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:57,代码来源:AbstractPerformanceEvaluator.java

示例3: AbstractPerformanceEvaluator

import com.rapidminer.operator.ports.metadata.MetaDataUnderspecifiedError; //导入依赖的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;
        }
    });
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:49,代码来源:AbstractPerformanceEvaluator.java


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