Skip to content
Advertisement

How to use pickle to save sklearn model

I want to dump and load my Sklearn trained model using Pickle. How to do that?

Advertisement

Answer

Save:

JavaScript

Load:

JavaScript

In the specific case of scikit-learn, it may be better to use joblib’s replacement of pickle (dump & load), which is more efficient on objects that carry large numpy arrays internally as is often the case for fitted scikit-learn estimators:

Save:

JavaScript

Load:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement