save model pickle
with open('model_pkl', 'wb') as files:
pickle.dump(model, files)
with open('model_pkl' , 'rb') as f:
lr = pickle.load(f)
save model pickle
with open('model_pkl', 'wb') as files:
pickle.dump(model, files)
with open('model_pkl' , 'rb') as f:
lr = pickle.load(f)
save and load a machine learning model using Pickle
#Save the model using pickle
import pickle
# save the model to disk
pickle.dump(model, open(model_file_path, 'wb'))
#Load the model
model = pickle.load(open(model_file_path, 'rb'))
#Saving a Keras model
# Calling `save('my_model')` creates a SavedModel folder `my_model`.
model.save("my_model")
#Load a Keras Model
# It can be used to reconstruct the model identically.
reconstructed_model = keras.models.load_model("my_model")
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us