Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

general
communitycreator

# What is linear regression?

Mohammad Razi ul Haq

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Linear regression is used to predict the relationship between two variables or factors. One variable (independent variable) is used to predict the value for another variable (dependent variable).

Regression is a method of modeling a target value based on independent predictors.

Linear Regression is a supervised machine learning algorithm. It predicts the value within a continuous range of numbers.

## 1. Simple regression

Simple linear regression uses traditional slope-intercept form to produce the most accurate predictions. x represents our input data and y represents our prediction.

The motive of the linear regression algorithm is to find the best values for m and c in the equation y = mx + c.

Graph for a line following the equation y=mx+c.

## 2. Multiple linear regression

Multiple linear regression has one dependent variable and two or more independent variables.

## Assumptions in linear regression

There are a few assumptions we make when using linear regression:

• The relationship between the dependent and independent variables should be almost linear.
• The data is homoscedasticThe variance between the results should not be too much.
• The results obtained from observation should not be influenced by the results obtained from the previous observation.
• The residuals should be normally distributed. This assumption means that the probability density function of the residual values is normally distributed at each independent value.

## Uses of linear regression

Linear regression can be used for:

• determining the strength of predictors
• forecasting an effect
• trend forecasting

RELATED TAGS

general
communitycreator

CONTRIBUTOR

Mohammad Razi ul Haq

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring

Learn in-demand tech skills in half the time 