Learn how easy it is to save and load scikit-learn models or pipelines. You can save a pipeline to disk. This is also a quick way to distribute new models to production.
- [Instructor] After we run some experiments, and trained our model, normally the next step would be to save it to disk and maybe ship it to production. Again, sci-kit learn makes this easy. In Python, we have a model called pickle, which can store and retrieve almost any Python object. The pickle format is Python specific so we can't save a sci-kit learn model as pickle and have Java load it. With different production is using python as well, this becomes a non-issue. Let's try it out. We'll import the pickle model and then read open, model.pickle.
And wb, writing in binary mode is out, we do pickle.dump pipe, out. Now we have a file called model.pickle. We will directly use it, we will do with open model.pickle and this time we read it in a binary format. Let's call this one pipe1 = pickle.load from the file. And now we can use the model, let's do pipe1.steps and these are the same steps we had before and we can even do pipe1.score X test and y test and get the same score as before.
And the same way we save the model to a file, we can save it over the network, store it in the database, or whatever we'd like to do with it.
- Working with Jupyter notebooks
- Using code cells
- Extensions to the Python language
- Markdown cells
- Editing notebooks
- NumPy basics
- Broadcasting, array operations, and ufuncs
- Folium and Geo
- Machine learning with scikit-learn
- Plotting with matplotlib and bokeh
- Branching into Numba, Cython, deep learning, and NLP
Skill Level Intermediate
NumPy Data Science Essential Trainingwith Charles Kelly3h 54m Intermediate
1. Scientific Python Overview
2. The Jupyter Notebook
3. NumPy Basics
Manage environments5m 11s
6. Folium and Geo
7. NY Taxi Data
10. Other Packages
11. Development Process
Next steps1m 33s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.