April 2016
Beginner to intermediate
384 pages
8h 36m
English
Linear regression is arguably the simplest model that one can build. It is a model of choice if you know that the relationship between your dependent variable and independent ones is linear.
To execute this recipe, you will need pandas, NumPy, and Scikit. No other prerequisites are required.
Estimating the regression model with Scikit is extremely easy (the regression_linear.py file):
import sys sys.path.append('..') # the rest of the imports import helper as hlp import pandas as pd import numpy as np import sklearn.linear_model as lm @hlp.timeit def regression_linear(x,y): ''' Estimate a linear regression ''' # create the regressor object linear = lm.LinearRegression(fit_intercept=True, ...Read now
Unlock full access