Skip to content

Commit

Permalink
Updated JPMML-SkLearn dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
vruusmann committed Dec 4, 2024
1 parent a5b9ec8 commit 8a453b1
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 22 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@
</issueManagement>

<properties>
<jpmml-sklearn.version>1.8.6</jpmml-sklearn.version>
<jpmml-sklearn.version>1.8.7</jpmml-sklearn.version>
<project.build.outputTimestamp>2024-10-28T21:00:00Z</project.build.outputTimestamp>
</properties>

<dependencies>
<dependency>
<groupId>org.jpmml</groupId>
<artifactId>pmml-converter</artifactId>
<version>1.5.9</version>
</dependency>

<dependency>
<groupId>org.jpmml</groupId>
<artifactId>pmml-sklearn</artifactId>
Expand Down
22 changes: 11 additions & 11 deletions sklearn2pmml/resources/classpath.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified sklearn2pmml/resources/sklearn2pmml-1.0-SNAPSHOT.jar
Binary file not shown.
17 changes: 7 additions & 10 deletions src/main/java/com/sklearn2pmml/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand All @@ -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

{
Expand Down

0 comments on commit 8a453b1

Please sign in to comment.