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 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.