Data Science (Python) :: Linear Regression

Sunil Kumar SV
1 min readJun 29, 2017

--

Intention of this post is to give a quick refresher (thus, it’s assumed that you are already familiar with the stuff) of Linear Regression (using Python). You can treat this as FAQ’s as well.

Library for Linear Regression?

from sklearn.linear_model import LinearRegression
var_regressor = LinearRegression()
var_regressor.fit(var_X, var_Y) # This fits the Linear Regression model on independant variable matrix var_X and dependent vector var_Y

*************************************************

In which kind of dataset does Linear Regression model is best suited?

A dataset which looks more like a straight line. For e.g., Flat prices as per the size of the flat. In almost all the cases, the price of the flat rises as per the size of the flat

*************************************************

Sample linear regression equation?

var_priceOfFlat = xonstant_z +( var_sizeOfTheFlat * var_coeffiixent)

Next :- Data Science (Python) :: Multiple Linear Regression

Prev :- Data Science (Python) :: Basics

If you liked this article, please hit the ❤ icon below

--

--

Sunil Kumar SV

#ProductManager #TechEnthusiast #DataScienceEnthusiast #LoveToSolveProblemsUsingTech #Innovation