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

Martin Gütlein guetlein at posteo.de
Wed Jun 14 03:13:47 EDT 2023


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



More information about the scikit-learn mailing list