Building Predictive Models Using Penalized Linear Methods - Bowles, Michael (Machine Learning with Spark and Python, 2020)
This chapter discusses building predictive models using penalized linear methods. It demonstrates the use of penalized regression along with a number of general tools for predictive modeling. The chapter utilizes Python packages incarnating various different flavors of penalized regression for these tasks. It introduces several new elements, one is using the string indexer to transform labels in a multiclass problem and another is using PySpark logistic regression for a multiclass problem. The chapter shows how to use PySpark logistic regression and introduced the PySpark Pipeline framework to doing the required data transformations. These include techniques for coding factor variables as numeric, for using a binary classifier to solve multiclass classification problems, and for extending linear methods to predict nonlinear relationships between attributes and outcomes. Predicting the wine taste is a regression problem because the objective of the problem is to predict the quality score, which is an integer between 0 and 10.