9. Regression

9.1 Introduction

Model fitting is the process of estimating a model’s parameters. In other chapters, we described linear regression as a specific example. Now, you’ll develop that example with a little more detail. You’ll find this same basic pattern throughout the book. It works well for linear regression, and you’ll see the same structure for more advanced models like deep neural networks.

Generally, the first step is to start plotting the data with scatter plots and histograms to see how it is distributed. When you’re plotting, you might see something like Figure 9.1. The constant slope to the data, even when there is a lot of noise around the trend, suggests that y is related linearly to x.

Figure 9.1 Random data from ...

Get Machine Learning in Production: Developing and Optimizing Data Science Workflows and Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.