Introduction_to_ML_Linear_Regression_Lecture_Slides
Introduction_to_ML_Linear_Regression_Lecture_Slides
[email protected]
6LGU0EZJIR
Linear Regression
[email protected]
6LGU0EZJIR
Mpg
Weight
2
This file is meant for personal use by [email protected] 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?
[email protected]
6LGU0EZJIR
3
This file is meant for personal use by [email protected] 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 [email protected] 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.
[email protected]
6LGU0EZJIR
6
This file is meant for personal use by [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.
[email protected]
6LGU0EZJIR
7
This file is meant for personal use by [email protected] 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?
[email protected]
6LGU0EZJIR
Mpg
Weight
8
This file is meant for personal use by [email protected] 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
[email protected]
6LGU0EZJIR
Weight
9
This file is meant for personal use by [email protected] 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 [email protected] 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.
[email protected]
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 [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.
So...
[email protected]
6LGU0EZJIR
12
This file is meant for personal use by [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.
How good is our regression fit?
[email protected]
6LGU0EZJIR
• Need measures of goodness of fit?
13
This file is meant for personal use by [email protected] 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 [email protected] 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 [email protected] 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
[email protected]
6LGU0EZJIR
• Adjusted R2
17
This file is meant for personal use by [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.
Pros and Cons
• Advantages
•
[email protected]
6LGU0EZJIR Disadvantages
18
This file is meant for personal use by [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.