Ai Slides Regression
Ai Slides Regression
Regression
Agenda
• Introduction of ML (Machine Learning)
• What is Linear Regression?
• Its importance through use-cases. (Applications)
• How it works? (Mathematical Working)
• Evaluation Metrics
• LR implementation with python
• Lecture Take-Away
4/11/2023 2
“
Introduction of ML
Machine learning is a field of artificial
intelligence that allows systems to
”
learn and improve from experience
without being explicitly programmed.
3
Types of ML
Machine
Learning
Semi- Reinforcement
Supervised Unsupervised
Supervised Learning
4
Types of ML
Machine
Learning
Semi- Reinforcement
Supervised Unsupervised
Supervised Learning
7
Applications
Uses of Linear Regression.
Applications
• Stock Price Prediction
• Sales Forecasting
• Real Estate Price Prediction
• Player Performance Prediction
• Energy Consumption Prediction
9
Mathematics
How linear regression works?
Mathematics Calculations:
Intercept
- Equation of Line:
Ads (X) Sales (Y)
Y = mx + c or = ) + bo
1 14 Slope:
“Unit of change in Y due to X”
3 24
- Formula for regression coefficient:
2 18
b1 =
1 17
bo = )
11
Mathematics Calculations:
Ads (X) Sales (Y) (X – ) () (X – )() (X – )2
1 14 -1 -6 6 1
3 24 1 4 4 1
2 18 0 -2 0 0
1 17 -1 -3 3 1
3 27 -1 7 7 1
=2 = 20 = 20 =4
12
Regression Line (Chart)
13
Evaluation
Metrics
To evaluate model
performance.
Evaluation Metrics
Mean squared error Coefficient of determination
(MSE). (R2):
15
Linear Regression code
4-11-2023 AI 18