I have standardized my data in sklearn using preprocessing.standardscaler. Question is how could I save this in my local for latter use?
Thanks
If I understand you correctly you want to save your trained model so it can be loaded again correct?
There are two methods, using python's pickle
and the other method which is to use joblib
. The recommend method is joblib
as this will result in a much smaller file than a pickle, which dumps a string representation of your object:
from sklearn.externals import joblib
joblib.dump(clf, 'filename.pkl')
#then load it later, remember to import joblib of course
clf = joblib.load('filename.pk1')
See the online docs
Note: sklearn.externals.joblib
is deprecated. Install and use the pure joblib
instead
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With