Use sklearn to save model
1 pickle
import pickle
# write
with open(r"D:/model.pickle", "wb") as f:
pickle.dump(model, f)
# read
with open(r"D:/model.pickle", "rb") as f:
model = pickle.load(f)
2 joblib
from sklearn.externals import joblib
# write
joblib.dump(model, r"D:model.joblib")
# read
model = joblib.load(r"D:model.joblib")