← Back to list

Multiple Linear Regression

You can access the code HERE:

Nabin Adhikari · 2022-12-29 14:24 · 0 claps · 2.7 min read
#multiple-linearregression #mlrs
Open on Medium ↗
Wiki topics: ML · Machine Learning

Multiple Linear Regression

You can access the code HERE:

**https://github.com/nabinadhikari96/100-days-of-machine-learning/tree/main/day50-multiple-linear-regression**

Multiple linear regression is a statistical method used to model the linear relationship between a response variable and one or more predictor variables. It is an extension of simple linear regression, which only allows for the modeling of a linear relationship between a single predictor variable and a response variable.

In multiple linear regression, the response variable is modeled as a linear combination of the predictor variables, with each predictor variable being multiplied by a coefficient (also known as a weight or parameter) and the results being summed. The coefficients are estimated using a variety of techniques, such as least squares or maximum likelihood, which aim to minimize the difference between the predicted values and the observed values in the data.

Multiple linear regression can be used for a wide range of applications, including prediction, causal inference, and understanding the relationships between different variables. It is a powerful tool for understanding and modeling complex systems, and it is widely used in fields such as economics, engineering, and the social sciences.

Example:

Suppose we have a dataset with two predictor variables (x1 and x2) and a response variable (y). We can use multiple linear regression to model the relationship between y and x1 and x2 as follows:

y = β0 + β1x1 + β2x2

where β0, β1, and β2 are the coefficients or weights that are estimated from the data. The value of β0 is the intercept, which is the predicted value of y when x1 and x2 are both equal to zero. The values of β1 and β2 represent the effect of x1 and x2 on y, respectively.

Multiple linear regression can be used to make predictions about the response variable based on the values of the predictor variables. For example, if we know the values of x1 and x2 for a particular data point, we can use the estimated coefficients to predict the value of y. We can also use multiple linear regression to understand the relationships between the predictor variables and the response variable and to identify which variables are most important in predicting the response.

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -

In multiple linear regression, the response variable (y) is modeled as a linear combination of one or more predictor variables (x1, x2, …, xn). This can be written as:

y = β0 + β1x1 + β2x2 + … + βn*xn

where β0 is the intercept, and β1, β2, …, βn are the coefficients or weights for each predictor variable. These coefficients are estimated from the data using a variety of techniques, such as least squares or maximum likelihood, which aim to minimize the difference between the predicted values and the observed values in the data.

The goal of multiple linear regression is to find the values of the coefficients that best fit the data, in the sense that they minimize the difference between the predicted values and the observed values. This can be done using a variety of optimization algorithms, such as gradient descent or normal equations.

Once the coefficients have been estimated, they can be used to make predictions about the response variable based on the values of the predictor variables. For example, if we know the values of x1, x2, …, xn for a particular data point, we can use the estimated coefficients to predict the value of y. We can also use multiple linear regression to understand the relationships between the predictor variables and the response variable and to identify which variables are most important in predicting the response.

Multiple linear regression can be used for a wide range of applications, including prediction, causal inference, and understanding the relationships between different variables. It is a powerful tool for understanding and modeling complex systems, and it is widely used in fields such as economics, engineering, and the social sciences.


메타데이터
post_id
4f95ecff0a07
slug
multiple-linear-regression-4f95ecff0a07
url
https://medium.com/@nabinadhikari190/multiple-linear-regression-4f95ecff0a07
canonical_url
https://medium.com/@nabinadhikari190/multiple-linear-regression-4f95ecff0a07
author_url
https://medium.com/@nabinadhikari190
status
ok
fetched_at
2026-06-20 20:29:01