Implementing a regression model with scikit-learn on Vertex AI
The first SML model we’re going to build in our Vertex AI Workbench notebook is a linear regression model. You may remember that we described linear regression in Chapter 1.
Business case
Our boss at BigFlowers.com is running a fun competition at work. Employees are asked to predict the length of an iris flower’s petal when given some other measurements related to that flower, such as the sepal length, sepal width, and petal width. The person with the most accurate estimation will get a big prize, and employees are allowed to use technology to help them in their estimations, so we’re going to build an ML model to help us make these predictions.
In the previous section, we used the K-means algorithm within scikit-learn. In this section, we will use the linear regression algorithm within scikit-learn. As such, we will need to import the LinearRegression
class into our notebook context. We will...