# Linear Regression and Random Forest

Published in

--

For my 2nd article, I’ll be showing you on how to build a Multiple linear regression model to predict the price of cars and later comparing it with the accuracy of Random Forest along with some visuals.

Let’s get started!

Before we go on to do the coding part, we need to first understand the two questions.

What is Linear Regression?

LR is basically a model that explains the relationship between a response variable and one or more explanatory variable aka features. For example, demand and supply, higher the demand higher should the supply be.

The Equation of a LR is given by Y= AX + c, where Y is the dependent variable, X is the explanatory variable, A is the slope and c is the intercept.

Why Linear Regression?

Linear-regression models have become a proven way to scientifically and reliably predict the future. Because linear regression is a long-established statistical procedure, the properties of linear-regression models are well understood and can be trained very quickly.

Now, lets go through an example on how to predict Car price using Linear regression.

`import numpy as np import pandas as pd import seaborn as snsimport matplotlib.pyplot as plt`

--

--

A professional data storyteller with a perfect blend of Statistics and computational Science.