Model Pipelines Workout
- 01:59
How to verify the proper definition of machine learning pipelines, including lasso, ridge, elastic net, random forest, and gradient booster.
Downloads
No associated resources to download.
Transcript
In your Jupyter notebook, complete the following steps to add two more pipelines to your pipelines dictionary. First import random forest regressor and gradient boosting regressor from the Scikit-learn module, SK learn dot ensemble. And note that these are case sensitive, so it needs to match exactly.
Then add pipelines for each model class to the pipelines dictionary with a random state of one. Use the string RF as the key for the random forest pipeline and the string GB for the key for the gradient booster pipeline.
Before starting this lesson, you should have completed the code that you see right here, importing the lasso and the ridge model, importing the make pipeline function, and importing the standard scaler function. You also should have created this new dictionary, pipelines, and created items for lasso with the lasso pipeline and with the ridge pipeline as well. You also should have imported the elastic net model and created a pipelines item for elastic net. For this exercise, you're gonna start by importing the random forest regressor and gradient boosting regressor models. Then we're going to add new pipelines to our pipeline dictionary. So we're gonna call the first one, the string RF, use the make pipeline function followed by the standard scaler function, and then the random forest regressor model with a random state of one. And then we're gonna call the gradient boosting item GB for the key and use the make pipeline function with the standards scaler function and the gradient boosting regressor model. Also with a random state of one.
Once you execute that cell and add those pipelines to your dictionary, you're going to execute this code, which you should already find in your Jupyter notebook, and make sure that you're getting the same results that you see right here to guarantee that your pipelines have been set up correctly.