static Optional<DataField> getTargetDataField(final Model model) {
        DataType targetDataType = getTargetDataType(model.getMiningFunction(), model.getMathContext());
        OpType targetOpType = getTargetOpType(model.getMiningFunction());
        if (targetDataType == null || targetOpType == null) {
            return Optional.empty();
        }
        String cleanedName = model.getModelName().replaceAll("[^A-Za-z0-9]", "");
        String fieldName = String.format(TARGETFIELD_TEMPLATE, cleanedName);
        DataField toReturn = new DataField();
        toReturn.setName(fieldName);
        toReturn.setOpType(targetOpType);
        toReturn.setDataType(targetDataType);
        return Optional.of(toReturn);
    }
@Test
    void getTargetDataField() throws Exception {
        final InputStream inputStream = getFileInputStream(NO_TARGET_FIELD_SAMPLE);
        final PMML pmml = org.jpmml.model.PMMLUtil.unmarshal(inputStream);
        final Model model = pmml.getModels().get(0);
        Optional<DataField> optionalDataField = KiePMMLUtil.getTargetDataField(model);
        assertThat(optionalDataField).isPresent();
        DataField retrieved = optionalDataField.get();
        String expected = String.format(TARGETFIELD_TEMPLATE, "golfing");
        assertThat(retrieved.getName()).isEqualTo(expected);
    }