Search in sources :

Example 1 with KiePMMLDiscretize

use of org.kie.pmml.commons.model.expressions.KiePMMLDiscretize in project drools by kiegroup.

the class KiePMMLDiscretizeInstanceFactoryTest method getKiePMMLDiscretize.

@Test
public void getKiePMMLDiscretize() {
    Discretize toConvert = getRandomDiscretize();
    KiePMMLDiscretize retrieved = KiePMMLDiscretizeInstanceFactory.getKiePMMLDiscretize(toConvert);
    commonVerifyKiePMMLDiscretize(retrieved, toConvert);
}
Also used : PMMLModelTestUtils.getRandomDiscretize(org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getRandomDiscretize) Discretize(org.dmg.pmml.Discretize) KiePMMLDiscretize(org.kie.pmml.commons.model.expressions.KiePMMLDiscretize) InstanceFactoriesTestCommon.commonVerifyKiePMMLDiscretize(org.kie.pmml.compiler.commons.factories.InstanceFactoriesTestCommon.commonVerifyKiePMMLDiscretize) KiePMMLDiscretize(org.kie.pmml.commons.model.expressions.KiePMMLDiscretize) InstanceFactoriesTestCommon.commonVerifyKiePMMLDiscretize(org.kie.pmml.compiler.commons.factories.InstanceFactoriesTestCommon.commonVerifyKiePMMLDiscretize) Test(org.junit.Test)

Example 2 with KiePMMLDiscretize

use of org.kie.pmml.commons.model.expressions.KiePMMLDiscretize in project drools by kiegroup.

the class KiePMMLDiscretizeInstanceFactory method getKiePMMLDiscretize.

static KiePMMLDiscretize getKiePMMLDiscretize(final Discretize discretize) {
    List<KiePMMLDiscretizeBin> discretizeBins = discretize.hasDiscretizeBins() ? getKiePMMLDiscretizeBins(discretize.getDiscretizeBins()) : Collections.emptyList();
    String mapMissingTo = discretize.getMapMissingTo() != null ? discretize.getMapMissingTo().toString() : null;
    String defaultValue = discretize.getDefaultValue() != null ? discretize.getDefaultValue().toString() : null;
    DATA_TYPE dataType = discretize.getDataType() != null ? DATA_TYPE.byName(discretize.getDataType().value()) : null;
    return new KiePMMLDiscretize(discretize.getField().getValue(), getKiePMMLExtensions(discretize.getExtensions()), discretizeBins, mapMissingTo, defaultValue, dataType);
}
Also used : KiePMMLDiscretizeBin(org.kie.pmml.commons.model.expressions.KiePMMLDiscretizeBin) DATA_TYPE(org.kie.pmml.api.enums.DATA_TYPE) KiePMMLDiscretize(org.kie.pmml.commons.model.expressions.KiePMMLDiscretize)

Aggregations

KiePMMLDiscretize (org.kie.pmml.commons.model.expressions.KiePMMLDiscretize)2 Discretize (org.dmg.pmml.Discretize)1 Test (org.junit.Test)1 DATA_TYPE (org.kie.pmml.api.enums.DATA_TYPE)1 KiePMMLDiscretizeBin (org.kie.pmml.commons.model.expressions.KiePMMLDiscretizeBin)1 PMMLModelTestUtils.getRandomDiscretize (org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getRandomDiscretize)1 InstanceFactoriesTestCommon.commonVerifyKiePMMLDiscretize (org.kie.pmml.compiler.commons.factories.InstanceFactoriesTestCommon.commonVerifyKiePMMLDiscretize)1