GithubHelp home page GithubHelp logo

Comments (6)

vruusmann avatar vruusmann commented on August 20, 2024

This is a very-very odd bug report. The SkLearn2PMML project is based on the JPMML-SkLearn library, which includes two integration test cases for GradientBoostingClassifier:
https://github.com/jpmml/jpmml-sklearn/blob/master/src/test/java/org/jpmml/sklearn/ClassifierTest.java#L57-L60
https://github.com/jpmml/jpmml-sklearn/blob/master/src/test/java/org/jpmml/sklearn/ClassifierTest.java#L147-L150

If the JPMML-SkLearn library was generating incorrect PMML markup for the second segment, then these integration test cases should cause the build process to error out.

The working copy of JPMML-SkLearn already includes JPMML-Converter library version 1.2.4:
jpmml/jpmml-sklearn@79a4547

So, you need to wait a couple more days until SkLearn2PMML version 0.20.4 is released, which shall be based on the latest and greatest JPMML-SkLearn library version.

from sklearn2pmml.

sabba avatar sabba commented on August 20, 2024

Hi Villu,
yes is very odd!

In order to understand the issue i checked out JPMML-SkLearn to version 1.3.3 which depend of jpmml-converter-1.2.3 and te full test suite run green.

Then, I tried to export a PMML document using the converter-executable-1.3.3.jar produced in "target" with the following command and the tree was surprising right!

java -jar converter-executable-1.3.3.jar --pkl-pipeline-input ..\src\test\resources\pkl\GradientBoostingAudit.pkl --pmml-output GradientBoostingAudit.pmml

Could be the case that the jar included statically as jpmml-converter-1.2.3 in SkLearn2PMML was not generated from the right code base?

I'va have installed SkLearn2PMML using pip pointing to the git repository.

Thank you for the support!

from sklearn2pmml.

vruusmann avatar vruusmann commented on August 20, 2024

Could be the case that the jar included statically as jpmml-converter-1.2.3 in SkLearn2PMML was not generated from the right code base?

I've experienced a situation, where the resources directory of an installed sklearn2pmml package contains several versions of the same library JAR file (eg. JPMML-Converter versions 1.2.0, 1.2.3). The JVM then adds the first out-of-date JAR file (eg. 1.2.0) to classpath, and ignores the second up-to-date JAR file (eg. 1.2.3). Such classpath conflicts may lead to all sorts of unexpected outcomes, starting with JVM class loader/verifier errors and ending with incorrectly generated PMML markup.

Could it be that you had multiple versions of the JPMML-Converter library in the resources directory? This could happen if you install a new version of the sklearn2pmml package, without properly uninstalling the old version first.

Anyway, a good "fix" for library errors is to 1) delete the sklearn2pmml subdirectory from the site-packages directory of your active Python installation, and 2) install a the latest version of the sklearn2pmml package from GitHub.

from sklearn2pmml.

sabba avatar sabba commented on August 20, 2024

Could it be that you had multiple versions of the JPMML-Converter library in the resources directory? This could happen if you install a new version of the sklearn2pmml package, without properly uninstalling the old version first.

I think is not my case because i never installed before the package... BUT, In order to have locally this pull request (that you merged today) jpmml/jpmml-sklearn#46 I have put a recompiled version of the jpmml-sklearn jar inside my resources directory.

Could be this the root cause?

from sklearn2pmml.

vruusmann avatar vruusmann commented on August 20, 2024

I have put a recompiled version of the jpmml-sklearn jar inside my resources directory.

For documentation purposes, these are the steps for updating the JPMML-SkLearn dependency of the SkLearn2PMML package:

  1. Update JPMML-SkLearn version in pom.xml. When working with locally tweaked JPMML-SkLearn library, then the version identifier is typically 1.3-SNAPSHOT.
  2. Manually delete all JAR files from the /sklearn2pmml/resources directory (only __init__.py should remain).
  3. Execute Apache Maven build mvn clean package. This will download the JPMML-SkLearn library, and all its transitive dependencies into the /sklearn2pmml/resources directory.
  4. Optionally, update the version identifier in sklearn2pmml/metadata.py. For example, introduce some sort of suffix to signal that this is a "tweaked" version, not an official version.

from sklearn2pmml.

sabba avatar sabba commented on August 20, 2024

Ok! Thank You.

from sklearn2pmml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.