You are on page 1of 2

Linear regression attempts to model the relationship between two variables by fitting a linear

equation (= a straight line) to the observed data. One variable is considered to be an


explanatory variable (e.g. your income), and the other is considered to be a dependent
variable (e.g. your expenses). What linear regression does is simply tell us the value of the
dependent variable for an arbitrary independent/explanatory variable. e.g. Twitter revenues
based on number of Twitter users .

From a machine learning context, it is the simplest model one can try out on your data. If you
have a hunch that the data follows a straight line trend, linear regression can give you quick
and reasonably accurate results.

Simple predictions are all cases of linear regression. We first observe the trend and then
predict based on the trend e.g. How hard you must brake depending on the distance of the car
ahead of you.

Hence it is important to understand that even though linear regression can be the first attempt
at understanding the data it may not always be ideal.

Here’s how we do linear regression

We plot our dependent variable (y-axis) against the independent variable (x-axis)

We try to plot a straight line and measure correlation

We keep changing the direction of our straight line until we get the best correlation

We extrapolate from this line to find new values on y-axis

Let us look at a linear equation

Yi= Bo + BiXi

Where Yi = Dependant variable

Bo = Y intercept

Bi = Slope

Xi = Independent variable on which Yi depends

Similarly you can see on the graph, equation of a line y = mx + c

Where y = dependent variable


M = slope

X = independent / explanatory variable

C = y intercept which is a constant.

You might also like