本文整理汇总了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);
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例7: ContinuousOutputFeature
import org.dmg.pmml.OutputField; //导入方法依赖的package包/类
public ContinuousOutputFeature(PMMLEncoder encocder, Output output, OutputField outputField){
this(encocder, output, outputField.getName(), outputField.getDataType());
}