• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ResultFeature类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createPredictedOutput

import org.dmg.pmml.ResultFeature; //导入依赖的package包/类
static
public Output createPredictedOutput(FieldName name, OpType opType, DataType dataType, Transformation... transformations){
	List<OutputField> outputFields = new ArrayList<>();

	OutputField outputField = new OutputField(name, dataType)
		.setOpType(opType)
		.setResultFeature(ResultFeature.PREDICTED_VALUE)
		.setFinalResult(false);

	outputFields.add(outputField);

	for(Transformation transformation : transformations){
		outputField = new OutputField(transformation.getName(outputField.getName()), transformation.getDataType(outputField.getDataType()))
			.setOpType(transformation.getOpType(outputField.getOpType()))
			.setResultFeature(ResultFeature.TRANSFORMED_VALUE)
			.setFinalResult(transformation.isFinalResult())
			.setExpression(transformation.createExpression(new FieldRef(outputField.getName())));

		outputFields.add(outputField);
	}

	return new Output(outputFields);
}
 
开发者ID:jpmml,项目名称:jpmml-converter,代码行数:24,代码来源:ModelUtil.java


示例2: visit

import org.dmg.pmml.ResultFeature; //导入依赖的package包/类
@Override
public VisitorAction visit(OutputField outputField){
	ResultFeature resultFeature = outputField.getResultFeature();

	switch(resultFeature){
		case TRANSFORMED_VALUE:
		case DECISION:
			{
				String segmentId = outputField.getSegmentId();

				if(segmentId != null){
					outputField.setValue(filter(outputField.getValue()));
				}
			}
			break;
		default:
			break;
	}

	return super.visit(outputField);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:22,代码来源:FieldNameFilterer.java


示例3: createAffinityField

import org.dmg.pmml.ResultFeature; //导入依赖的package包/类
static
public OutputField createAffinityField(FieldName name, DataType dataType, String value){
	OutputField outputField = new OutputField(name, dataType)
		.setOpType(OpType.CONTINUOUS)
		.setResultFeature(ResultFeature.AFFINITY)
		.setValue(value);

	return outputField;
}
 
开发者ID:jpmml,项目名称:jpmml-converter,代码行数:10,代码来源:ModelUtil.java


示例4: createEntityIdField

import org.dmg.pmml.ResultFeature; //导入依赖的package包/类
static
public OutputField createEntityIdField(FieldName name){
	OutputField outputField = new OutputField(name, DataType.STRING)
		.setOpType(OpType.CATEGORICAL)
		.setResultFeature(ResultFeature.ENTITY_ID);

	return outputField;
}
 
开发者ID:jpmml,项目名称:jpmml-converter,代码行数:9,代码来源:ModelUtil.java


示例5: createPredictedField

import org.dmg.pmml.ResultFeature; //导入依赖的package包/类
static
public OutputField createPredictedField(FieldName name, DataType dataType, OpType opType){
	OutputField outputField = new OutputField(name, dataType)
		.setOpType(opType)
		.setResultFeature(ResultFeature.PREDICTED_VALUE);

	return outputField;
}
 
开发者ID:jpmml,项目名称:jpmml-converter,代码行数:9,代码来源:ModelUtil.java


示例6: createProbabilityField

import org.dmg.pmml.ResultFeature; //导入依赖的package包/类
static
public OutputField createProbabilityField(FieldName name, DataType dataType, String value){
	OutputField outputField = new OutputField(name, dataType)
		.setOpType(OpType.CONTINUOUS)
		.setResultFeature(ResultFeature.PROBABILITY)
		.setValue(value);

	return outputField;
}
 
开发者ID:jpmml,项目名称:jpmml-converter,代码行数:10,代码来源:ModelUtil.java


示例7: toContinuousFeature

import org.dmg.pmml.ResultFeature; //导入依赖的package包/类
@Override
public ContinuousOutputFeature toContinuousFeature(DataType dataType){
	ContinuousOutputFeature continuousFeature = toContinuousFeature();

	if((dataType).equals(continuousFeature.getDataType())){
		return continuousFeature;
	}

	PMMLEncoder encoder = ensureEncoder();

	FieldName name = FieldName.create((dataType.name()).toLowerCase() + "(" + (continuousFeature.getName()).getValue() + ")");

	Output output = getOutput();

	OutputField outputField = OutputUtil.getOutputField(output, name);
	if(outputField == null){
		outputField = new OutputField(name, dataType)
			.setOpType(OpType.CONTINUOUS)
			.setResultFeature(ResultFeature.TRANSFORMED_VALUE)
			.setFinalResult(false)
			.setExpression(continuousFeature.ref());

		output.addOutputFields(outputField);
	}

	return new ContinuousOutputFeature(encoder, output, outputField.getName(), outputField.getDataType());
}
 
开发者ID:jpmml,项目名称:jpmml-sklearn,代码行数:28,代码来源:ContinuousOutputFeature.java


示例8: visit

import org.dmg.pmml.ResultFeature; //导入依赖的package包/类
@Override
public VisitorAction visit(OutputField outputField){
	ResultFeature resultFeature = outputField.getResultFeature();

	switch(resultFeature){
		case STANDARD_ERROR:
			report(new UnsupportedAttributeException(outputField, resultFeature));
			break;
		default:
			break;
	}

	return super.visit(outputField);
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:15,代码来源:UnsupportedMarkupInspector.java


示例9: withProbabilityCol

import org.dmg.pmml.ResultFeature; //导入依赖的package包/类
public TransformerBuilder withProbabilityCol(String columnName, List<String> labels){
	Evaluator evaluator = getEvaluator();

	List<TargetField> targetFields = evaluator.getTargetFields();
	if(targetFields.size() != 1){
		throw new IllegalArgumentException();
	}

	TargetField targetField = targetFields.get(0);

	List<String> values = new ArrayList<>();

	List<OutputField> outputFields = evaluator.getOutputFields();
	for(OutputField outputField : outputFields){
		org.dmg.pmml.OutputField pmmlOutputField = outputField.getOutputField();

		ResultFeature resultFeature = pmmlOutputField.getResultFeature();
		switch(resultFeature){
			case PROBABILITY:
				String value = pmmlOutputField.getValue();

				if(value != null){
					values.add(value);
				}
				break;
			default:
				break;
		}
	}

	if(values.isEmpty()){
		throw new IllegalArgumentException();
	} // End if

	if(labels != null && (labels.size() != values.size() || !labels.containsAll(values))){
		throw new IllegalArgumentException();
	}

	this.columnProducers.add(new ProbabilityColumnProducer(targetField, columnName, labels != null ? labels : values));

	return this;
}
 
开发者ID:jeremyore,项目名称:spark-pmml-import,代码行数:43,代码来源:TransformerBuilder.java


示例10: createInputFields

import org.dmg.pmml.ResultFeature; //导入依赖的package包/类
protected List<InputField> createInputFields(){
	List<InputField> inputFields = getActiveFields();

	List<OutputField> outputFields = getOutputFields();
	if(outputFields.size() > 0){
		List<TargetReferenceField> targetReferenceFields = null;

		for(OutputField outputField : outputFields){
			org.dmg.pmml.OutputField pmmlOutputField = outputField.getOutputField();

			if(!(pmmlOutputField.getResultFeature()).equals(ResultFeature.RESIDUAL)){
				continue;
			}

			int depth = outputField.getDepth();
			if(depth > 0){
				throw new UnsupportedElementException(pmmlOutputField);
			}

			FieldName targetFieldName = pmmlOutputField.getTargetField();
			if(targetFieldName == null){
				targetFieldName = getTargetFieldName();
			}

			DataField dataField = getDataField(targetFieldName);
			if(dataField == null){
				throw new MissingFieldException(targetFieldName, pmmlOutputField);
			}

			MiningField miningField = getMiningField(targetFieldName);
			if(miningField == null){
				throw new InvisibleFieldException(targetFieldName, pmmlOutputField);
			}

			Target target = getTarget(targetFieldName);

			TargetReferenceField targetReferenceField = new TargetReferenceField(dataField, miningField, target);

			if(targetReferenceFields == null){
				targetReferenceFields = new ArrayList<>();
			}

			targetReferenceFields.add(targetReferenceField);
		}

		if(targetReferenceFields != null && targetReferenceFields.size() > 0){
			inputFields = ImmutableList.copyOf(Iterables.concat(inputFields, targetReferenceFields));
		}
	}

	return inputFields;
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:53,代码来源:ModelEvaluator.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BigIntUtils类代码示例发布时间:2022-05-23
下一篇:
Java RenderCow类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap