commonly used name model.bin
f_out to tell that this is the output file
pickle.dump → save
we use pipeline beacause
from sklearn.pipeline import make_pipeline
pipeline = make_pipeline(
DictVectorizer(),
LogisticRegression(solver='liblinear')
)
with open('model.bin', 'wb') as f_out:
pickle.dump(pipeline, f_out)
with open('model.bin', 'rb') as f_in:
pipeline = pickle.load(f_in)
## it should work in github code space
jupyter nbconvert --to=script notebook_name.ipynb