Introduction_to_ML_Linear_Regression_Lecture_Slides
Introduction_to_ML_Linear_Regression_Lecture_Slides
kumar.sovan@gmail.com
6LGU0EZJIR
Linear Regression
kumar.sovan@gmail.com
6LGU0EZJIR
Mpg
Weight
2
This file is meant for personal use by kumar.sovan@gmail.com only.
Data Source: StatLib (http://lib.stat.cmu.edu/datasets/)
Sharing or publishing the contents in part or full is liable for legal action.
Which one has a stronger relationship?
kumar.sovan@gmail.com
6LGU0EZJIR
3
This file is meant for personal use by kumar.sovan@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
Measures of Association
4
This file is meant for personal use by kumar.sovan@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
• Covariance:
• The covariance between a variable and itself is the variance of the variable.
• Correlation
• The correlation between X and Y is the same as the correlation between Y and X.
kumar.sovan@gmail.com
6LGU0EZJIR
6
This file is meant for personal use by kumar.sovan@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
kumar.sovan@gmail.com
6LGU0EZJIR
7
This file is meant for personal use by kumar.sovan@gmail.com only.
Source: Wikipedia
Sharing or publishing the contents in part or full is liable for legal action.
Salaries and Expenses
• Next: If a car’s weight is 4000, what would we expect its Mpg to be?
kumar.sovan@gmail.com
6LGU0EZJIR
Mpg
Weight
8
This file is meant for personal use by kumar.sovan@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
How easy is it to fit a straight line?
Mpg
kumar.sovan@gmail.com
6LGU0EZJIR
Weight
9
This file is meant for personal use by kumar.sovan@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
One possibility that makes sense...
10
This file is meant for personal use by kumar.sovan@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
Least Squares Estimation
• Note that:
• Residual: The difference between the actual and fitted values of the response variable.
kumar.sovan@gmail.com
6LGU0EZJIR • Observed Value: The actual value of the response variable
• Least Squares line is the one that minimizes the sum of the
squared residuals.
11
This file is meant for personal use by kumar.sovan@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
So...
kumar.sovan@gmail.com
6LGU0EZJIR
12
This file is meant for personal use by kumar.sovan@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
How good is our regression fit?
kumar.sovan@gmail.com
6LGU0EZJIR
• Need measures of goodness of fit?
13
This file is meant for personal use by kumar.sovan@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
Measures of Regression Fit
14
This file is meant for personal use by kumar.sovan@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
Measures of Regression Fit
• Coefficient of determination
P
e2i
R2 = 1 P
(yi ȳ)2
16
This file is meant for personal use by kumar.sovan@gmail.com only.
Data Source: StatLib (http://lib.stat.cmu.edu/datasets/)
Sharing or publishing the contents in part or full is liable for legal action.
Standard Error and Adjusted R2
kumar.sovan@gmail.com
6LGU0EZJIR
• Adjusted R2
17
This file is meant for personal use by kumar.sovan@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
Pros and Cons
• Advantages
•
kumar.sovan@gmail.com
6LGU0EZJIR Disadvantages
18
This file is meant for personal use by kumar.sovan@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.