Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ModuleNotFoundError: No module named 'sklearn.linear_model._base'

I am trying to load a model saved as a .joblib file. I have tried pickle, sklearn.externals.joblib and joblib itself. All the same error. Below is an example of what I am trying to do.

 clf = joblib.load("linear_regression_model.joblib")

This model was made using sklearn.linear_model.LinearRegression. However, when I try to open this file, I get this error:

ModuleNotFoundError: No module named 'sklearn.linear_model._base'

Package Versions:

Python 3.7.5

Sklearn 0.21.3

Joblib 0.14.0

Scipy 1.3.2

Any idea of what is going on? Thanks in advance.

like image 683
Natalie Avatar asked Dec 10 '19 07:12

Natalie


1 Answers

Figured it out. The model was created on a different system with a different version of sklearn. Loading in the model on the same system it was created on caused no problems.

like image 92
Natalie Avatar answered Nov 07 '22 22:11

Natalie