Introduction - To - ML - Linear - Regression - Lecture - Slides New
Introduction - To - ML - Linear - Regression - Lecture - Slides New
[email protected]
YHZEPDBA51
Linear Regression
[email protected]
YHZEPDBA51
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]
YHZEPDBA51
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]
YHZEPDBA51
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]
YHZEPDBA51
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]
YHZEPDBA51
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]
YHZEPDBA51
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]
YHZEPDBA51
• 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]
YHZEPDBA51
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]
YHZEPDBA51
• 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]
YHZEPDBA51
• 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
• Disadvantages
[email protected]
YHZEPDBA51
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.