本文整理匯總了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;
}