liveBook · Manning

Linear regression

As explained in Data Without Labels

A linear transformation is a mapping that preserves vector addition and scalar multiplication.

Linear regression predicts a continuous value from labeled examples. Given people’s heights and weights, it can fit a relationship that takes height as input and predicts weight. Height is the independent variable; weight is the target. section 1.5.1

A simple model writes the prediction as Weight = β0 × height + β1. One coefficient scales height; the other adds a constant. With multiple inputs, the relationship can be written Y = β0 + β1x1 + β2x2 + … + ε. The displayed formulas use different coefficient numbering, so read each coefficient by its position in the equation. section 1.5.1

Figure 1.12 Raw data that needs to be modeled (left). Using regression, a line of best fit is identified (right).
figure

Compare the raw observations with the fitted line: the line summarizes a relationship that can be used to predict a continuous target. section 1.5.1

Choose regression for quantities such as revenue or rainfall, not for categorical answers such as whether a transaction is fraudulent. Linear regression can produce values below 0 or above 1, so its output is not suitable as a classification probability. section 1.5.1 section 1.7

How Data Without Labels covers it

How deep it goes
Defines simple and multiple linear equations and illustrates a fitted line, without developing a training procedure.
Examples
Uses height to predict weight and names revenue and rainfall as other continuous targets.
What it assumes
Introduces independent variables and targets through a height-and-weight example rather than assuming that terminology.
What you can do after
Evaluate/understand it by identifying a continuous prediction task and reading a linear fit as a relationship between inputs and target.
How it connects
Contrasts regression with classification and logistic regression through their different prediction targets.

Also explained in

Compare how 22 books explain linear regression →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Without Labels. The section links point to the parts of the book it draws on.