本文整理汇总了Java中org.dmg.pmml.FieldUsageType类的典型用法代码示例。如果您正苦于以下问题:Java FieldUsageType类的具体用法?Java FieldUsageType怎么用?Java FieldUsageType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FieldUsageType类属于org.dmg.pmml包,在下文中一共展示了FieldUsageType类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractTargetField
import org.dmg.pmml.FieldUsageType; //导入依赖的package包/类
static
private FieldName extractTargetField(Model model){
FieldName targetField = null;
MiningSchema miningSchema = model.getMiningSchema();
List<MiningField> miningFields = miningSchema.getMiningFields();
for(Iterator<MiningField> it = miningFields.iterator(); it.hasNext(); ){
MiningField miningField = it.next();
FieldUsageType fieldUsage = miningField.getUsageType();
switch(fieldUsage){
case PREDICTED:
case TARGET:
{
if(targetField != null){
throw new IllegalArgumentException();
}
targetField = miningField.getName();
it.remove();
}
break;
default:
break;
}
}
return targetField;
}
示例2: createMiningSchema
import org.dmg.pmml.FieldUsageType; //导入依赖的package包/类
public static MiningSchema createMiningSchema(double[] weights) {
MiningSchema miningSchema = new MiningSchema();
MiningField[] miningFields = new MiningField[weights.length + 1];
for (int i = 0; i < weights.length; i++) {
miningFields[i] = creatMiningField("field_" + Integer.toString(i), FieldUsageType.ACTIVE);
}
miningFields[weights.length] = creatMiningField("target", FieldUsageType.TARGET);
miningSchema.addMiningFields(miningFields);
return miningSchema;
}
示例3: creatMiningField
import org.dmg.pmml.FieldUsageType; //导入依赖的package包/类
private static MiningField creatMiningField(String name, FieldUsageType fieldUsageType) {
MiningField field = new MiningField();
field.setName(new FieldName(name));
field.setUsageType(fieldUsageType);
return field;
}