diff --git a/pom.xml b/pom.xml index 3734d95..5d5a8c1 100644 --- a/pom.xml +++ b/pom.xml @@ -33,11 +33,17 @@ - 1.8.6 + 1.8.7 2024-10-28T21:00:00Z + + org.jpmml + pmml-converter + 1.5.9 + + org.jpmml pmml-sklearn diff --git a/sklearn2pmml/resources/classpath.txt b/sklearn2pmml/resources/classpath.txt index 49e368f..2db26f4 100644 --- a/sklearn2pmml/resources/classpath.txt +++ b/sklearn2pmml/resources/classpath.txt @@ -1,8 +1,8 @@ sklearn2pmml-1.0-SNAPSHOT.jar gson-2.11.0.jar guava-33.3.1-jre.jar -h2o-genmodel-3.46.0.5.jar -h2o-logger-3.46.0.5.jar +h2o-genmodel-3.46.0.6.jar +h2o-logger-3.46.0.6.jar h2o-tree-api-0.3.17.jar istack-commons-runtime-4.0.1.jar jackson-annotations-2.17.2.jar @@ -12,18 +12,18 @@ jaxb-core-3.0.2.jar jaxb-runtime-3.0.2.jar jcommander-1.72.jar pickle-1.5.jar -pmml-converter-1.5.8.jar +pmml-converter-1.5.9.jar pmml-h2o-1.2.14.jar pmml-lightgbm-1.5.5.jar -pmml-model-1.6.6.jar -pmml-model-metro-1.6.6.jar +pmml-model-1.6.7.jar +pmml-model-metro-1.6.7.jar pmml-python-1.2.5.jar -pmml-sklearn-1.8.6.jar -pmml-sklearn-extension-1.8.6.jar -pmml-sklearn-h2o-1.8.6.jar -pmml-sklearn-lightgbm-1.8.6.jar -pmml-sklearn-statsmodels-1.8.6.jar -pmml-sklearn-xgboost-1.8.6.jar +pmml-sklearn-1.8.7.jar +pmml-sklearn-extension-1.8.7.jar +pmml-sklearn-h2o-1.8.7.jar +pmml-sklearn-lightgbm-1.8.7.jar +pmml-sklearn-statsmodels-1.8.7.jar +pmml-sklearn-xgboost-1.8.7.jar pmml-statsmodels-1.1.1.jar pmml-xgboost-1.8.7.jar serpent-1.40.jar diff --git a/sklearn2pmml/resources/h2o-genmodel-3.46.0.5.jar b/sklearn2pmml/resources/h2o-genmodel-3.46.0.6.jar similarity index 86% rename from sklearn2pmml/resources/h2o-genmodel-3.46.0.5.jar rename to sklearn2pmml/resources/h2o-genmodel-3.46.0.6.jar index e00f0b6..236e7da 100644 Binary files a/sklearn2pmml/resources/h2o-genmodel-3.46.0.5.jar and b/sklearn2pmml/resources/h2o-genmodel-3.46.0.6.jar differ diff --git a/sklearn2pmml/resources/h2o-logger-3.46.0.5.jar b/sklearn2pmml/resources/h2o-logger-3.46.0.6.jar similarity index 74% rename from sklearn2pmml/resources/h2o-logger-3.46.0.5.jar rename to sklearn2pmml/resources/h2o-logger-3.46.0.6.jar index dd41e37..7e7152b 100644 Binary files a/sklearn2pmml/resources/h2o-logger-3.46.0.5.jar and b/sklearn2pmml/resources/h2o-logger-3.46.0.6.jar differ diff --git a/sklearn2pmml/resources/pmml-converter-1.5.8.jar b/sklearn2pmml/resources/pmml-converter-1.5.9.jar similarity index 87% rename from sklearn2pmml/resources/pmml-converter-1.5.8.jar rename to sklearn2pmml/resources/pmml-converter-1.5.9.jar index 7cfdba6..e431f62 100644 Binary files a/sklearn2pmml/resources/pmml-converter-1.5.8.jar and b/sklearn2pmml/resources/pmml-converter-1.5.9.jar differ diff --git a/sklearn2pmml/resources/pmml-model-1.6.6.jar b/sklearn2pmml/resources/pmml-model-1.6.7.jar similarity index 77% rename from sklearn2pmml/resources/pmml-model-1.6.6.jar rename to sklearn2pmml/resources/pmml-model-1.6.7.jar index bb3adb2..0ffb43e 100644 Binary files a/sklearn2pmml/resources/pmml-model-1.6.6.jar and b/sklearn2pmml/resources/pmml-model-1.6.7.jar differ diff --git a/sklearn2pmml/resources/pmml-model-metro-1.6.6.jar b/sklearn2pmml/resources/pmml-model-metro-1.6.7.jar similarity index 56% rename from sklearn2pmml/resources/pmml-model-metro-1.6.6.jar rename to sklearn2pmml/resources/pmml-model-metro-1.6.7.jar index 67250bc..9a7ac9f 100644 Binary files a/sklearn2pmml/resources/pmml-model-metro-1.6.6.jar and b/sklearn2pmml/resources/pmml-model-metro-1.6.7.jar differ diff --git a/sklearn2pmml/resources/pmml-sklearn-1.8.6.jar b/sklearn2pmml/resources/pmml-sklearn-1.8.7.jar similarity index 89% rename from sklearn2pmml/resources/pmml-sklearn-1.8.6.jar rename to sklearn2pmml/resources/pmml-sklearn-1.8.7.jar index 2d6b30b..8d16fa2 100644 Binary files a/sklearn2pmml/resources/pmml-sklearn-1.8.6.jar and b/sklearn2pmml/resources/pmml-sklearn-1.8.7.jar differ diff --git a/sklearn2pmml/resources/pmml-sklearn-extension-1.8.6.jar b/sklearn2pmml/resources/pmml-sklearn-extension-1.8.7.jar similarity index 90% rename from sklearn2pmml/resources/pmml-sklearn-extension-1.8.6.jar rename to sklearn2pmml/resources/pmml-sklearn-extension-1.8.7.jar index 369d586..643fd77 100644 Binary files a/sklearn2pmml/resources/pmml-sklearn-extension-1.8.6.jar and b/sklearn2pmml/resources/pmml-sklearn-extension-1.8.7.jar differ diff --git a/sklearn2pmml/resources/pmml-sklearn-h2o-1.8.6.jar b/sklearn2pmml/resources/pmml-sklearn-h2o-1.8.7.jar similarity index 78% rename from sklearn2pmml/resources/pmml-sklearn-h2o-1.8.6.jar rename to sklearn2pmml/resources/pmml-sklearn-h2o-1.8.7.jar index 7d4dcc5..638902d 100644 Binary files a/sklearn2pmml/resources/pmml-sklearn-h2o-1.8.6.jar and b/sklearn2pmml/resources/pmml-sklearn-h2o-1.8.7.jar differ diff --git a/sklearn2pmml/resources/pmml-sklearn-lightgbm-1.8.6.jar b/sklearn2pmml/resources/pmml-sklearn-lightgbm-1.8.7.jar similarity index 76% rename from sklearn2pmml/resources/pmml-sklearn-lightgbm-1.8.6.jar rename to sklearn2pmml/resources/pmml-sklearn-lightgbm-1.8.7.jar index 7d960cd..ea4c2c0 100644 Binary files a/sklearn2pmml/resources/pmml-sklearn-lightgbm-1.8.6.jar and b/sklearn2pmml/resources/pmml-sklearn-lightgbm-1.8.7.jar differ diff --git a/sklearn2pmml/resources/pmml-sklearn-statsmodels-1.8.6.jar b/sklearn2pmml/resources/pmml-sklearn-statsmodels-1.8.7.jar similarity index 69% rename from sklearn2pmml/resources/pmml-sklearn-statsmodels-1.8.6.jar rename to sklearn2pmml/resources/pmml-sklearn-statsmodels-1.8.7.jar index 758e927..b6da662 100644 Binary files a/sklearn2pmml/resources/pmml-sklearn-statsmodels-1.8.6.jar and b/sklearn2pmml/resources/pmml-sklearn-statsmodels-1.8.7.jar differ diff --git a/sklearn2pmml/resources/pmml-sklearn-xgboost-1.8.6.jar b/sklearn2pmml/resources/pmml-sklearn-xgboost-1.8.7.jar similarity index 83% rename from sklearn2pmml/resources/pmml-sklearn-xgboost-1.8.6.jar rename to sklearn2pmml/resources/pmml-sklearn-xgboost-1.8.7.jar index 3099a5c..a89e264 100644 Binary files a/sklearn2pmml/resources/pmml-sklearn-xgboost-1.8.6.jar and b/sklearn2pmml/resources/pmml-sklearn-xgboost-1.8.7.jar differ diff --git a/sklearn2pmml/resources/sklearn2pmml-1.0-SNAPSHOT.jar b/sklearn2pmml/resources/sklearn2pmml-1.0-SNAPSHOT.jar index 642fa39..8be5efb 100644 Binary files a/sklearn2pmml/resources/sklearn2pmml-1.0-SNAPSHOT.jar and b/sklearn2pmml/resources/sklearn2pmml-1.0-SNAPSHOT.jar differ diff --git a/src/main/java/com/sklearn2pmml/Main.java b/src/main/java/com/sklearn2pmml/Main.java index 2f017de..5702198 100644 --- a/src/main/java/com/sklearn2pmml/Main.java +++ b/src/main/java/com/sklearn2pmml/Main.java @@ -34,13 +34,13 @@ import org.dmg.pmml.PMML; import org.dmg.pmml.Version; import org.jpmml.converter.Application; -import org.jpmml.converter.SAXTransformerUtil; import org.jpmml.converter.VersionConverter; -import org.jpmml.converter.visitors.VersionStandardizer; import org.jpmml.model.MarkupException; -import org.jpmml.model.filters.ExportFilter; +import org.jpmml.model.PMMLOutputStream; import org.jpmml.model.metro.MetroJAXBUtil; import org.jpmml.model.visitors.VersionChecker; +import org.jpmml.model.visitors.VersionDowngrader; +import org.jpmml.model.visitors.VersionStandardizer; import org.jpmml.python.PickleUtil; import org.jpmml.python.Storage; import org.jpmml.python.StorageUtil; @@ -112,6 +112,9 @@ private void run() throws Exception { VersionStandardizer versionStandardizer = new VersionStandardizer(); versionStandardizer.applyTo(pmml); + VersionDowngrader versionDowngrader = new VersionDowngrader(this.version); + versionDowngrader.applyTo(pmml); + VersionChecker versionChecker = new VersionChecker(this.version); versionChecker.applyTo(pmml); @@ -131,15 +134,9 @@ private void run() throws Exception { } } - File tempFile = File.createTempFile("sklearn2pmml-", ".pmml"); - - try(OutputStream os = new FileOutputStream(tempFile)){ + try(OutputStream os = new PMMLOutputStream(new FileOutputStream(this.outputFile), this.version)){ MetroJAXBUtil.marshalPMML(pmml, os); } - - SAXTransformerUtil.transform(tempFile, this.outputFile, new ExportFilter(this.version)); - - tempFile.delete(); } else {