
Hands-On Data Analysis with Pandas
By :

Complete the following exercises to practice the skills covered in this chapter. Be sure to consult the Machine learning workflow section in the Appendix as a refresher on the process of building models:
a) Using the data/stars.csv
file, build a pipeline to normalize the data with a MinMaxScaler
object and then run elastic net linear regression using all the numeric columns to predict the temperature of the star.
b) Run grid search on the pipeline to find the best values for alpha
, l1_ratio
, and fit_intercept
for the elastic net in the search space of your choice.
c) Train the model on 75% of the initial data.
d) Calculate the R2 of your model.
e) Find the coefficients for each regressor and the intercept.
f) Visualize the residuals using the plot_residuals()
function from the ml_utils.regression
module.