[scikit-learn] version warning - do I have to fix the minor version when unpickling?

Martin Gütlein guetlein at posteo.de
Thu Jun 15 02:47:26 EDT 2023


Hi Guillaume,

thanks for your swift reply. So that means we should even fix the patch 
version, right?

And, this goes into both directions? So the service executing the code 
should not have a newer version, not even a patch, then the version the 
pickeled model was built with?

Cheers, Martin


Am 14.06.2023 18:24 schrieb Guillaume Lemaître:
> Hi Martin,
> 
> The public API is stable but the internal can change which can affect
> the pickle.
> For instance, calling a missing private function that does not exist
> can happen.
> Since that we don’t guarantee any support in this regard, this is
> the reason why a warning is raised even between minor or patch
> version.
> 
> Cheers,
> 
> On Wed, 14 Jun 2023 at 09:34, Martin Gütlein <guetlein at posteo.de>
> wrote:
> 
>> Hi,
>> 
>> I just got the warning:
>> 
>> "site-packages/sklearn/base.py:318: UserWarning: Trying to unpickle
>> 
>> estimator DecisionTreeRegressor from version 1.1.2 when using
>> version
>> 1.2.2. This might lead to breaking code or invalid results. Use at
>> your
>> own risk".
>> 
>> because I only fixed the major version (i.e, my dependency is
>> "scikit-learn>=1,<2"). I assumed that code version 1.2 is
>> compatible to
>> pickeled models from version 1.1. Is this not true?
>> 
>> Do I have to change to fix the minor version instead (i.e., use
>> "scikit-learn>=1.2,<1.3")?
>> 
>> Kind regards,
>> Martin
>> 
>> _______________________________________________
>> scikit-learn mailing list
>> scikit-learn at python.org
>> https://mail.python.org/mailman/listinfo/scikit-learn [1]
> 
> --
> 
> Guillaume Lemaitre
> 
> Scikit-learn @ Inria Foundation
> https://glemaitre.github.io/ [2]
> 
> Links:
> ------
> [1] https://mail.python.org/mailman/listinfo/scikit-learn
> [2] https://glemaitre.github.io/
> 
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn


More information about the scikit-learn mailing list