What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-07 22:50:11
read pickle file
with open('filename', 'rb') as f: x = pickle.load(f) Add solution -
Python 2021-10-24 18:31:07
command to read file in python using pandas
import panda as pd file_csv = pd.read_csv("file path") ## as csv format file_excel = pd.read_excel("file path") ## as excel format file_json = pd.read_json("file path") ## as json format file_html = pd.read_html("file... Add solution -
Other 2021-10-24 02:35:13
can't pickle module objects
You can't pickle an entire module, you'll have to break the module up into the attributes you need, for example this problem occured to me when I was trying to multiprocess opencv2, instead of sending in the whole module I just sent in the attributes: wai... Add solution -
Python 2021-10-23 03:58:10
pip pickle
#pip pip install pickle-mixin #import library import pickle Add solution -
Python 2021-10-12 12:21:03
sklearn save 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 =... Add solution -
Python 2021-10-11 11:44:11
save and load sklearn model PKL
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) Add solution -
Other 2021-10-08 14:47:07
load saved model pyspark
print(spark.version) 2.4.3 # fit model cvModel = cv_grid.fit(train_df) # save best model to specified path mPath = "/path/to/model/folder" cvModel.bestModel.write().overwrite().save(mPath) # read pickled model via pipeline api from pyspark.m... Add solution
Best helpers
Ranking is empty