use of org.kie.pmml.commons.model.tuples.KiePMMLNameOpType in project drools by kiegroup.
the class ModelUtils method getTargetFields.
/**
* Return a <code>List<KiePMMLNameOpType></code> of target fields
* Please note that only <b>predicted/target</b>
* <code>MiningField</code> are considered.
* @param fields
* @param model
* @return
*/
public static List<KiePMMLNameOpType> getTargetFields(final List<Field<?>> fields, final Model model) {
List<KiePMMLNameOpType> toReturn = new ArrayList<>();
if (model.getMiningSchema() != null && model.getMiningSchema().getMiningFields() != null) {
for (MiningField miningField : model.getMiningSchema().getMiningFields()) {
if (MiningField.UsageType.TARGET.equals(miningField.getUsageType()) || MiningField.UsageType.PREDICTED.equals(miningField.getUsageType())) {
OP_TYPE opType = getOpType(fields, model, miningField.getName().getValue());
toReturn.add(new KiePMMLNameOpType(miningField.getName().getValue(), opType));
}
}
}
return toReturn;
}
Aggregations