From 2827bec6307d429a5fe6da8449141c33964c6e8a Mon Sep 17 00:00:00 2001 From: Villu Ruusmann Date: Fri, 21 Jul 2023 12:13:13 +0300 Subject: [PATCH] Updated JPMML-Converter dependency --- .../main/java/org/jpmml/rexp/RExpEncoder.java | 25 ++++--------------- pom.xml | 6 ++--- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/pmml-rexp/src/main/java/org/jpmml/rexp/RExpEncoder.java b/pmml-rexp/src/main/java/org/jpmml/rexp/RExpEncoder.java index 98bb0af..288eb6f 100644 --- a/pmml-rexp/src/main/java/org/jpmml/rexp/RExpEncoder.java +++ b/pmml-rexp/src/main/java/org/jpmml/rexp/RExpEncoder.java @@ -32,12 +32,11 @@ import org.dmg.pmml.OpType; import org.dmg.pmml.PMML; import org.jpmml.converter.CategoricalFeature; -import org.jpmml.converter.CategoricalLabel; import org.jpmml.converter.ContinuousFeature; -import org.jpmml.converter.ContinuousLabel; import org.jpmml.converter.Feature; import org.jpmml.converter.Label; import org.jpmml.converter.ModelEncoder; +import org.jpmml.converter.ScalarLabelUtil; import org.jpmml.converter.Schema; import org.jpmml.converter.TypeUtil; import org.jpmml.model.visitors.FieldRenamer; @@ -105,21 +104,7 @@ public Schema createSchema(){ } public void setLabel(DataField dataField){ - Label label; - - OpType opType = dataField.requireOpType(); - switch(opType){ - case CATEGORICAL: - label = new CategoricalLabel(dataField); - break; - case CONTINUOUS: - label = new ContinuousLabel(dataField); - break; - default: - throw new IllegalArgumentException(); - } - - setLabel(label); + setLabel(ScalarLabelUtil.createScalarLabel(dataField)); } public void addFeature(Field field){ @@ -127,12 +112,12 @@ public void addFeature(Field field){ OpType opType = field.requireOpType(); switch(opType){ - case CATEGORICAL: - feature = new CategoricalFeature(this, (DataField)field); - break; case CONTINUOUS: feature = new ContinuousFeature(this, field); break; + case CATEGORICAL: + feature = new CategoricalFeature(this, (DataField)field); + break; default: throw new IllegalArgumentException(); } diff --git a/pom.xml b/pom.xml index af3d658..913dced 100644 --- a/pom.xml +++ b/pom.xml @@ -70,12 +70,12 @@ org.jpmml pmml-converter - 1.5.4 + 1.5.5 org.jpmml pmml-converter-testing - 1.5.4 + 1.5.5 @@ -87,7 +87,7 @@ org.jpmml pmml-xgboost - 1.7.3 + 1.7.4