Skip to content

Commit

Permalink
Updated JPMML-Converter dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
vruusmann committed Jul 21, 2023
1 parent 3e15baa commit 2827bec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
25 changes: 5 additions & 20 deletions pmml-rexp/src/main/java/org/jpmml/rexp/RExpEncoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -105,34 +104,20 @@ 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){
Feature feature;

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();
}
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@
<dependency>
<groupId>org.jpmml</groupId>
<artifactId>pmml-converter</artifactId>
<version>1.5.4</version>
<version>1.5.5</version>
</dependency>
<dependency>
<groupId>org.jpmml</groupId>
<artifactId>pmml-converter-testing</artifactId>
<version>1.5.4</version>
<version>1.5.5</version>
</dependency>

<dependency>
Expand All @@ -87,7 +87,7 @@
<dependency>
<groupId>org.jpmml</groupId>
<artifactId>pmml-xgboost</artifactId>
<version>1.7.3</version>
<version>1.7.4</version>
</dependency>

<dependency>
Expand Down

0 comments on commit 2827bec

Please sign in to comment.