ML - Linear Regression
ML - Linear Regression
- Presented by
Mr. P. MEENATCHISUNDARAM
Lesson 2
Linear Regression
2
Linear Algorithms
Models based on linear regression are called Linear
Algorithms. Some of the Linear Algorithms are:
Logistic Regression
3
Linear regression Models
Many simple models follow linear regression
• y = B0 + B1 x [y=mx+c]
• The model that follows linear equation
Making Predictions with Linear Regression
• Imagine we are predicting weight (y) from height (x).
• y = B0 + B1 X1
weight = B0 + B1 × height
• Where B0 is the bias coefficient and
• B1 is the coefficient for the height column.
4
Simple Linear Regression
For example, let’s use B0 = 0.1 and B1 = 0.5. Let’s
plug them in and calculate the weight (in kilograms)
for a person with the height of 182 centimeters.
• weight = 0.1 + 0.5 × 182 weight = 91.1
5
Tutorial for Linear Regression
Using Tutorial Data Set Find Bo and B1
X 1 2 4 3 5
Y 1 3 3 2 5
7
Estimating the Slope and Intercept (B1, B0)
• X 1 2 4 3 5 Xmean = 3
Y 1 3 3 2 5 Ymean =2.8
(X-Xmean)^2
X-Xmean -2 -1 1 0 2 = 10
By Calculation:
RMSE = 0.6928
9
Linear Regression
Exercise 1
Data Set
X 5 7 9 12 15
Y 26 32 40 54 64
10
An Error is not a Mistake until you
refuse to correct it.
11