Georg Heiler
Georg Heiler

Reputation: 17674

sk-learn saved model to disk, but get only array

When storing a fitted_clf sk-learn classifier like:

joblib.dump(fitted_clf, some_path)

Most of the time when loading it back into memory like:

joblib.load(some_path)

only an array of array(['col1', 'col2], dtype=object) is returned instead of loading the fitted pipeline.

However, sometimes I get the real pipeline, but do not understand why this is not a consistent behavior.

edit

I think this has to do with different joblib verisions i.e. from sklearn.externals import joblib works, but when using regular joblib I only get an array

Upvotes: 3

Views: 338

Answers (1)

Georg Heiler
Georg Heiler

Reputation: 17674

confirmed. Using sklearn.externals import joblib is fixing this to have consistent behavior.

Upvotes: 5

Related Questions