Answers for "Save and Load Machine Learning Models in Python with scikit-learn Finding an accurate machine learning model is not the end of any project. So how to save and load your machine learning model in Python using scikit-learn."

7

save machine learning model python

model.fit(X_train, Y_train)
# save the model to disk
filename = 'finalized_model.sav'
pickle.dump(model, open(filename, 'wb'))
 
# load the model from disk
loaded_model = pickle.load(open(filename, 'rb'))
result = loaded_model.score(X_test, Y_test)
Posted by: Guest on March-06-2020

Code answers related to "Save and Load Machine Learning Models in Python with scikit-learn Finding an accurate machine learning model is not the end of any project. So how to save and load your machine learning model in Python using scikit-learn."

Python Answers by Framework

Browse Popular Code Answers by Language