Recall & Review
beginner
What is the purpose of saving a machine learning pipeline?
Saving a pipeline lets you reuse the trained model and all its steps later without retraining. It helps to deploy or share the model easily.
Click to reveal answer
beginner
What Python libraries are commonly used to save machine learning pipelines?
The two common libraries are joblib and pickle. Both can save and load pipelines efficiently.
Click to reveal answer
beginner
How do you save a pipeline using joblib?
Use
joblib.dump(pipeline, 'filename.joblib') to save and pipeline = joblib.load('filename.joblib') to load it back.Click to reveal answer
intermediate
What is a key difference between joblib and pickle for saving pipelines?
Joblib is faster and better for large numpy arrays inside pipelines, while pickle is more general but slower for big data.
Click to reveal answer
intermediate
Why should you be careful when loading pipelines saved with pickle?
Loading pickle files can run harmful code if the file is from an untrusted source. Always load pickle files you trust.
Click to reveal answer
Which library is recommended for saving large machine learning pipelines with numpy arrays?
✗ Incorrect
Joblib is optimized for saving large numpy arrays efficiently, making it better for big pipelines.
What function is used to save a pipeline with joblib?
✗ Incorrect
The correct function to save with joblib is joblib.dump().
What is a risk of loading a pipeline saved with pickle from an unknown source?
✗ Incorrect
Pickle can run arbitrary code when loading, so untrusted files can be dangerous.
Which of these is NOT a reason to save a pipeline?
✗ Incorrect
Saving a pipeline does not make the model slower; it helps reuse it faster.
How do you load a saved pipeline using joblib?
✗ Incorrect
Use joblib.load() to load a pipeline saved with joblib.
Explain how and why you would save a machine learning pipeline using joblib.
Think about saving the whole process to avoid retraining.
You got /4 concepts.
Describe the security concerns when loading pipelines saved with pickle and how to handle them.
Consider what happens if the file is from an unknown source.
You got /3 concepts.