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


Java OutputField.getDataType方法代码示例

本文整理汇总了Java中org.dmg.pmml.OutputField.getDataType方法的典型用法代码示例。如果您正苦于以下问题:Java OutputField.getDataType方法的具体用法?Java OutputField.getDataType怎么用?Java OutputField.getDataType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.dmg.pmml.OutputField的用法示例。


在下文中一共展示了OutputField.getDataType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerOutputFields

import org.dmg.pmml.OutputField; //导入方法依赖的package包/类
@Override
public List<OutputField> registerOutputFields(Label label, SparkMLEncoder encoder){
	T model = getTransformer();

	String predictionCol = model.getPredictionCol();

	OutputField predictedField = ModelUtil.createPredictedField(FieldName.create(predictionCol), DataType.STRING, OpType.CATEGORICAL);

	Feature feature = new Feature(encoder, predictedField.getName(), predictedField.getDataType()){

		@Override
		public ContinuousFeature toContinuousFeature(){
			throw new UnsupportedOperationException();
		}
	};

	encoder.putOnlyFeature(predictionCol, feature);

	return Collections.singletonList(predictedField);
}
 
开发者ID:jpmml,项目名称:jpmml-sparkml,代码行数:21,代码来源:ClusteringModelConverter.java

示例2: toContinuousFeature

import org.dmg.pmml.OutputField; //导入方法依赖的package包/类
@Override
public ContinuousOutputFeature toContinuousFeature(){
	PMMLEncoder encoder = ensureEncoder();

	Output output = getOutput();

	OutputField outputField = OutputUtil.getOutputField(output, getName());

	DataType dataType = outputField.getDataType();
	switch(dataType){
		case INTEGER:
		case FLOAT:
		case DOUBLE:
			break;
		default:
			throw new UnsupportedOperationException();
	}

	outputField.setOpType(OpType.CONTINUOUS);

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

示例3: apply

import org.dmg.pmml.OutputField; //导入方法依赖的package包/类
@Override
public Feature apply(Model model){
	Output output = model.getOutput();

	if(output == null || !output.hasOutputFields()){
		throw new IllegalArgumentException();
	}

	OutputField outputField = Iterables.getLast(output.getOutputFields());

	return new ContinuousFeature(null, outputField.getName(), outputField.getDataType());
}
 
开发者ID:jpmml,项目名称:jpmml-converter,代码行数:13,代码来源:MiningModelUtil.java

示例4: toContinuousFeature

import org.dmg.pmml.OutputField; //导入方法依赖的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

示例5: apply

import org.dmg.pmml.OutputField; //导入方法依赖的package包/类
@Override
public Feature apply(Model model){
    Output output = model.getOutput();

    if(output == null || !output.hasOutputFields()){
        throw new IllegalArgumentException();
    }

    OutputField outputField = Iterables.getLast(output.getOutputFields());

    return new ContinuousFeature(null, outputField.getName(), outputField.getDataType());
}
 
开发者ID:cheng-li,项目名称:pyramid,代码行数:13,代码来源:MiningModelUtil.java

示例6: CategoricalOutputFeature

import org.dmg.pmml.OutputField; //导入方法依赖的package包/类
public CategoricalOutputFeature(PMMLEncoder encoder, Output output, OutputField outputField, List<String> values){
	this(encoder, output, outputField.getName(), outputField.getDataType(), values);
}
 
开发者ID:jpmml,项目名称:jpmml-sklearn,代码行数:4,代码来源:CategoricalOutputFeature.java

示例7: ContinuousOutputFeature

import org.dmg.pmml.OutputField; //导入方法依赖的package包/类
public ContinuousOutputFeature(PMMLEncoder encocder, Output output, OutputField outputField){
	this(encocder, output, outputField.getName(), outputField.getDataType());
}
 
开发者ID:jpmml,项目名称:jpmml-sklearn,代码行数:4,代码来源:ContinuousOutputFeature.java


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