Machine Learining - Simple Linear Regression
Simple Linear Regression
What is Linear Regression?
Linear regression is a statistical method used to model the relationship between a dependent variable (Y) and an independent variable (X) by fitting a straight line to the observed data.
This line is known as the regression line, and its equation is:
Y=β0+β1X

Where:
- β₀ is the intercept (the value of Y when X = 0)
- β₁ is the slope (how much Y changes for a one-unit change in X)
The goal of linear regression is to find the best-fitting line that minimizes the sum of squared differences between observed and predicted values.
When to Use Linear Regression
Linear regression is used when you want to:
- Predict a numerical outcome based on another variable.
- Understand relationships between two continuous variables.
- Estimate trends or make forecasts based on existing data.
Examples of when to use it:
- Predicting a person’s salary based on years of experience.
- Estimating house prices based on square footage.
- Forecasting sales based on advertising spend.


Comments (1)
Code using Python : https://www.techtreeblogs.in/blog/view_page.php?id=394bcc52-91ce-49ac-875e-1f7bff3590b2
Leave a Comment