FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ImportError: cannot import name 'FEATURE_IMPORTANCE_TYPE_MAPPER' from 'lightgbm.basic' · Issue #488 · sdpython/mlprodict · GitHub

This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Repository navigation

This repository was archived by the owner on Jan 13, 2024. It is now read-only.

ImportError: cannot import name 'FEATURE_IMPORTANCE_TYPE_MAPPER' from 'lightgbm.basic' #488

Open

Description

This issue is caused when my poetry lock file was updated with lightgbm == 4.0.0. The relevant lightgbm issue is: lightgbm-org/LightGBM#5654 which updated FEATURE_IMPORTANCE_TYPE_MAPPER to _FEATURE_IMPORTANCE_TYPE_MAPPER.

This then affected the line https://github.com/sdpython/mlprodict/blame/27d6da4ecdd76e18292f265fde61d19b66937a5c/mlprodict/onnx_conv/helpers/lgbm_helper.py#L84

Maybe the solution here is to fix the dependency on LightGBM? ie. update

'scikit-learn>=1.0', 'skl2onnx>=1.12', 'lightgbm',
with <4.0.0?

Activity

  1. nitish20899 commented on Sep 26, 2023

    @fhaque Hello. Do you have the fix for this?

  2. xadupre commented on Oct 2, 2023

    Collaborator

    Not yet. The fix will be done in onnxmltools. The documentation of sklearn-onnx has been update to reflect that: https://onnx.ai/sklearn-onnx/auto_tutorial/plot_gexternal_lightgbm.html.

  3. Vignesh-95 commented on Oct 19, 2023

    Hi,
    Any updates on this. I am experiencing the very same issue

  4. janvdp commented on Nov 26, 2023

    If you cannot wait for the official releases of skl2onnx (v1.16.0) and onnxmltools (1.11.3), you can install them directly from GitHub:

    pip install --upgrade git+https://github.com/onnx/sklearn-onnx.git
    pip install --upgrade git+https://github.com/onnx/onnxmltools

    or with the commits I tested that currently work:

    pip install --upgrade git+https://github.com/onnx/sklearn-onnx.git@943cac213812a5ead520ac1edbbc5ddfa0fbb900
    pip install --upgrade git+https://github.com/onnx/onnxmltools@19847127edd283dc0140e3fc5ec23e25a1f6dca6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL