use of org.kie.pmml.commons.model.expressions.KiePMMLDiscretizeBin in project drools by kiegroup.
the class KiePMMLDiscretizeBinInstanceFactory method getKiePMMLDiscretizeBin.
static KiePMMLDiscretizeBin getKiePMMLDiscretizeBin(final DiscretizeBin discretizeBin) {
KiePMMLInterval interval = KiePMMLIntervalInstanceFactory.getKiePMMLInterval(discretizeBin.getInterval());
String binValue = discretizeBin.getBinValue() != null ? discretizeBin.getBinValue().toString() : null;
return new KiePMMLDiscretizeBin(UUID.randomUUID().toString(), getKiePMMLExtensions(discretizeBin.getExtensions()), binValue, interval);
}
use of org.kie.pmml.commons.model.expressions.KiePMMLDiscretizeBin in project drools by kiegroup.
the class KiePMMLDiscretizeBinInstanceFactoryTest method getKiePMMLDiscretizeBin.
@Test
public void getKiePMMLDiscretizeBin() {
DiscretizeBin toConvert = getRandomDiscretizeBin();
KiePMMLDiscretizeBin retrieved = KiePMMLDiscretizeBinInstanceFactory.getKiePMMLDiscretizeBin(toConvert);
commonVerifyKiePMMLDiscretizeBin(retrieved, toConvert);
}
use of org.kie.pmml.commons.model.expressions.KiePMMLDiscretizeBin 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);
}
Aggregations