Skip to content

fix: pin sklearn for compat with model pickles#4

Open
ceholden wants to merge 1 commit into
mainfrom
fix/pin-sklearn
Open

fix: pin sklearn for compat with model pickles#4
ceholden wants to merge 1 commit into
mainfrom
fix/pin-sklearn

Conversation

@ceholden

@ceholden ceholden commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR pins the scikit-learn package to the same major/minor version used by the model pickles. While I've had no issue running this with scikit-learn==1.8.0, it's risky to use different versions than what the pickle was saved as. Pickling models is an easy but complicated format for distributing trained models, and breakage across versions is one of the most common issues. A format like ONNX would be a better option for the future, but for now this PR locks the versions to stay in sync.

This resolves the warning emitted:

>>> loading lightgbm as tune machine learning model
/<path to python env>/lib/python3.13/site-packages/sklearn/base.py:463: InconsistentVersionWarning: Trying to unpickle estimator LabelEncoder from version 1.1.2 when using version 1.8.0. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:
https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations

@ceholden ceholden force-pushed the fix/pin-sklearn branch from bc71a1a to 4df6c1c Compare May 7, 2026 18:41
ceholden pushed a commit that referenced this pull request Jun 2, 2026
Make FMask compatible with newer NumPy versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant