Performing a linear regression

"In statistics, regression analysis is a statistical process for estimating the relationships among variables...More specifically, regression analysis helps one understand how the typical value of the dependent variable (or criterion variable) changes when any one of the independent variables is varied, while the other independent variables are held fixed."

Linear regression is an approach for predicting a quantitative response using a single feature (or predictor or input variable).

For this recipe, we are going to use the advertising dataset from An Introduction to Statistical Learning with Applications in R. It is provided with the book code, and can also be downloaded from http://www-bcf.usc.edu/~gareth/ISL/data.html ...

Get Python Business Intelligence Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.