- rishabhdwivedi062

# What is linear regression in machine learning

Updated: Oct 5, 2022

Linear regression is a statistical method that is used for predictive analysis. It is used to predict **sales**, **salary**, **prices**, **age**, etc.

Linear regression shows a linear relationship between the dependent variable (**Y**) and the independent variable (**x**). It tells us how the value of dependent variables changes according to the value of the independent variable.

**Linear Regression Equation**

**Y****=**** mx****+****c**

Y= Dependent Variable

x = Independent Variable

m = Slope of the line

c = Intercept (Tells at what point the line will cut the Y-axis)

**Types Linear Regression **

**Simple Linear Regression**: It uses single independent variables.**Multiple Linear Regression**: It uses more than one independent variable.

**Linear Regression Lines**

A line showing the relationship between dependent and independent variables is called a regression line. Is is of two types.

**1) Positive Linear Relationship:**

If a dependent variable increase on Y-axis and an independent variable increases on X-axis, then such a relationship is called Positive Linear Relationship.

**2) Negative Linear Relationship:**

If a dependent variable decreases on the Y-axis and independent variable increases on the X-axis, then such relationship is called a negative linear relationship.

Let's understand some concept.

As the va;ue of **C **increases, line shifts upwards but angle of the line does not changes.

If the value of **M **increases, the rate at which the value of **Y **increases with respect to **X **also increases.

This post is all about the theory, in the coming posts we will do a project and also see how to optimise it using the concept of gradient descent.