What is linear regression?
Linear regression tries to find a linear relationship between the predictor variables or the features and the target variable. The target variable is the dependent variable here and the features or the predictor variables are the independent variables.
Linear regression can be expressed using the following equation:
Y is the target variable, X1, X2, … Xn are the predictor variables or the features. And e is the error called the residual. β0, β1, … βn are called the coefficients, and they are selected in such a way that e or the error is minimum.
What is multiple linear regression?
Linear regression that involves more than one predictor variable is called multiple linear regression. So, as we discussed, the multiple linear regression can be expressed as:
As we discussed, Y is the target variable, X1, X2, … Xn are the predictor variables or the features. And e is the error called the residual. β0, β1, … βn are called the coefficients, and they are selected in such a way that e or the error is minimum.
Multiple Linear Regression using Python
Let’s say we are given a set of car models along with their horsepower, weight, acceleration, and mpg or miles driven per 1 gallon of gasoline. We want to create a multiple linear regression model using which we can determine the mpg of a car from its weight, horsepower, and acceleration.
We can use the following Python code for this multiple linear regression model…






0 Comments