Exercises
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:
- Predict star temperature with elastic net linear regression as follows:
a) Using the
data/stars.csv
file, build a pipeline to normalize the data with aMinMaxScaler
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
, andfit_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 theml_utils.regression
module. - Perform multiclass classification of white wine quality using a support vector machine and feature...