Search in sources :

Example 26 with DataField

use of org.dmg.pmml.DataField in project openscoring by openscoring.

the class ModelUtil method encodeInputFields.

private static List<Field> encodeInputFields(List<InputField> inputFields) {
    Function<InputField, Field> function = new Function<InputField, Field>() {

        @Override
        public Field apply(InputField inputField) {
            FieldName name = inputField.getName();
            DataField dataField = (DataField) inputField.getField();
            Field field = new Field(name.getValue());
            field.setName(dataField.getDisplayName());
            field.setDataType(inputField.getDataType());
            field.setOpType(inputField.getOpType());
            field.setValues(encodeValues(dataField));
            return field;
        }
    };
    List<Field> fields = new ArrayList<>(Lists.transform(inputFields, function));
    return fields;
}
Also used : InputField(org.jpmml.evaluator.InputField) OutputField(org.jpmml.evaluator.OutputField) DataField(org.dmg.pmml.DataField) TargetField(org.jpmml.evaluator.TargetField) Field(org.openscoring.common.Field) Function(com.google.common.base.Function) InputField(org.jpmml.evaluator.InputField) DataField(org.dmg.pmml.DataField) ArrayList(java.util.ArrayList) FieldName(org.dmg.pmml.FieldName)

Aggregations

DataField (org.dmg.pmml.DataField)26 Feature (org.jpmml.converter.Feature)13 FieldName (org.dmg.pmml.FieldName)12 ArrayList (java.util.ArrayList)9 ContinuousFeature (org.jpmml.converter.ContinuousFeature)8 CategoricalFeature (org.jpmml.converter.CategoricalFeature)5 DataType (org.dmg.pmml.DataType)4 DerivedField (org.dmg.pmml.DerivedField)4 OpType (org.dmg.pmml.OpType)4 Apply (org.dmg.pmml.Apply)3 CategoricalLabel (org.jpmml.converter.CategoricalLabel)3 ContinuousLabel (org.jpmml.converter.ContinuousLabel)3 Label (org.jpmml.converter.Label)3 Function (com.google.common.base.Function)2 MiningFunction (org.dmg.pmml.MiningFunction)2 BooleanFeature (org.jpmml.converter.BooleanFeature)2 InputField (org.jpmml.evaluator.InputField)2 OutputField (org.jpmml.evaluator.OutputField)2 TargetField (org.jpmml.evaluator.TargetField)2 Field (org.openscoring.common.Field)2