Skip to content

Commit

Permalink
Updated JPMML-Python dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
vruusmann committed Feb 10, 2024
1 parent bb0586e commit 3e61dc1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pmml-statsmodels/src/main/java/statsmodels/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
import org.jpmml.converter.ContinuousFeature;
import org.jpmml.converter.ContinuousLabel;
import org.jpmml.converter.Feature;
import org.jpmml.converter.FieldUtil;
import org.jpmml.converter.Label;
import org.jpmml.converter.PMMLUtil;
import org.jpmml.converter.Schema;
import org.jpmml.python.PythonObject;
import org.jpmml.statsmodels.InterceptFeature;
Expand Down Expand Up @@ -134,7 +134,7 @@ public List<Feature> encodeFeatures(List<String> exogNames, StatsModelsEncoder e
} // End if

if(!isFormula){
PMMLUtil.addValues(dataField, Collections.singletonList(value));
FieldUtil.addValues(dataField, Collections.singletonList(value));
}

features.add(new BinaryFeature(encoder, dataField, value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.dmg.pmml.mining.Segmentation;
import org.dmg.pmml.regression.RegressionModel;
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;
Expand Down Expand Up @@ -87,7 +88,8 @@ public org.dmg.pmml.Model encodeModel(List<? extends Number> params, Schema sche

Schema segmentSchema = schema.toAnonymousRegressorSchema(DataType.DOUBLE);

RegressionModel firstRegressionModel = RegressionModelUtil.createRegression(features, varsParams, (offset != null ? offset : 0d), RegressionModel.NormalizationMethod.NONE, segmentSchema);
RegressionModel firstRegressionModel = RegressionModelUtil.createRegression(features, varsParams, (offset != null ? offset : 0d), RegressionModel.NormalizationMethod.NONE, segmentSchema)
.setTargets(ModelUtil.createRescaleTargets(-1d, null, (ContinuousLabel)segmentSchema.getLabel()));

OutputField linpredOutputField = ModelUtil.createPredictedField("linpred", OpType.CONTINUOUS, DataType.DOUBLE);

Expand Down
4 changes: 2 additions & 2 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-python</artifactId>
<version>1.1.19</version>
<version>1.1.20</version>
</dependency>
<dependency>
<groupId>org.jpmml</groupId>
<artifactId>pmml-python-testing</artifactId>
<version>1.1.19</version>
<version>1.1.20</version>
</dependency>

<dependency>
Expand Down

0 comments on commit 3e61dc1

Please sign in to comment.