diff --git a/pmml-statsmodels/src/main/java/statsmodels/Model.java b/pmml-statsmodels/src/main/java/statsmodels/Model.java index 2319a0b..5aee340 100644 --- a/pmml-statsmodels/src/main/java/statsmodels/Model.java +++ b/pmml-statsmodels/src/main/java/statsmodels/Model.java @@ -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; @@ -134,7 +134,7 @@ public List encodeFeatures(List 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)); diff --git a/pmml-statsmodels/src/main/java/statsmodels/miscmodels/OrderedModel.java b/pmml-statsmodels/src/main/java/statsmodels/miscmodels/OrderedModel.java index 16f8b43..09315e5 100644 --- a/pmml-statsmodels/src/main/java/statsmodels/miscmodels/OrderedModel.java +++ b/pmml-statsmodels/src/main/java/statsmodels/miscmodels/OrderedModel.java @@ -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; @@ -87,7 +88,8 @@ public org.dmg.pmml.Model encodeModel(List 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); diff --git a/pom.xml b/pom.xml index 474097c..d409a46 100644 --- a/pom.xml +++ b/pom.xml @@ -70,12 +70,12 @@ org.jpmml pmml-python - 1.1.19 + 1.1.20 org.jpmml pmml-python-testing - 1.1.19 + 1.1.20