Horje
save machine learning model Code Example
save machine learning model
# fit the model
model.fit(X_train, y_train)

# save the model
import pickle
pickle.dump(model, open("model.pkl", "wb"))

# load the model
model = pickle.load(open("model.pkl", "rb"))

# use model to predict
y_pred = model.predict(X_input)
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)




Python

Related
how to check the django version on a mac Code Example how to check the django version on a mac Code Example
python add 1 to count Code Example python add 1 to count Code Example
pandas percent change Code Example pandas percent change Code Example
register modal in django admin Code Example register modal in django admin Code Example
how to wait in python Code Example how to wait in python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8