type
Post
Created date
Jun 16, 2022 01:21 PM
category
Data Science
tags
Machine Learning
Machine Learning
status
Published
Language
From
summary
slug
password
Author
Priority
Featured
Featured
Cover
Origin
Type
URL
Youtube
Youtube
icon
Local Regression
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fe1c5ba0e-562a-49b0-8505-ce5e38fc061b%2Fe6158b48-18ef-4886-80f8-afb9176569de%2FUntitled.png%3Fid%3D461e858a-311e-41db-a536-f9d0a62f1043%26table%3Dblock%26spaceId%3De1c5ba0e-562a-49b0-8505-ce5e38fc061b%26expirationTimestamp%3D1722088800000%26signature%3D_ck2WZ3fclWSQg0-6sAE-_T0vPPx-5hc-iAfe_TjEM8?table=block&id=461e858a-311e-41db-a536-f9d0a62f1043&cache=v2)
We slide a window across the predictor values, and only observations in that window are used to make a regression model.
The model here could be a linear regression, or even a polynomial model. After all, we average the values as they go further.
We treat EVERY observation sort of features in the middle of as one window.
- 🤬 Hard to write up an equation or function easily.
- 😀 Does well in the awkward relationship.
- Take a sliding window to compute regression model
- then combine the results by averaging
Assumption:
- Around point x, the mean of y can be approximated by a small class of parametric functions in polynomial regression.
- The errors in estimating y are independent and randomly distributed with a mean of zero.
- Bias and variance are traded off by the choices for the settings of span and degree of polynomial.
Polynomial Regression
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fe1c5ba0e-562a-49b0-8505-ce5e38fc061b%2F1097db1a-cb1d-4e4c-bae6-d24ef4717710%2FUntitled.png%3Fid%3Da2730f7c-369a-42d6-9304-9613a10eee8a%26table%3Dblock%26spaceId%3De1c5ba0e-562a-49b0-8505-ce5e38fc061b%26expirationTimestamp%3D1722088800000%26signature%3DBBY1-hB9TXIUdrAR5PCcKn9cJlT7KMoWn9x4lvIAqqM?table=block&id=a2730f7c-369a-42d6-9304-9613a10eee8a&cache=v2)
Polynomial Regression basically transforms (e.g., making x to be cubic) the variable to make a new variable, and then fit a model
Orthogonal Polynomial Regression makes the variables to be as uncorrelated as possible with the first variable; there's no correlation between the two variables so it sets up a system of new variables that are really just polynomials, but that's a special polynomial it adds additional parts
Assumption:
- the behavior of a dependent variable y is explained by a linear, or nonlinear — curvilinear, additive relationship between the dependent variable and a set of k independent variables (xi, i=1 to k)),
- the relationship between the dependent variable y and any independent variable xi is linear or curvilinear (specifically polynomial),
- the independent variables xi are independent of each other
- the errors are independent, normally distributed with mean zero and a constant variance (OLS).
Step Functions (Skipped in lecture 2 but used in tree models)
Essentially, cutting up all predictor into chunks.
Basis Functions
Regression Splines & Smoothing Splines
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fe1c5ba0e-562a-49b0-8505-ce5e38fc061b%2Fd849bcc0-8924-49e9-80ad-7476f411a82a%2Fdownload.png%3Fid%3Dc3198e5a-bf1b-47f9-8d85-f8882825b813%26table%3Dblock%26spaceId%3De1c5ba0e-562a-49b0-8505-ce5e38fc061b%26expirationTimestamp%3D1722088800000%26signature%3DEarZN9Z6wehcW94xCfKdixEDNU6ywnhNZty7aznKGvw?table=block&id=c3198e5a-bf1b-47f9-8d85-f8882825b813&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fe1c5ba0e-562a-49b0-8505-ce5e38fc061b%2Fd4736378-61f3-495d-a1e3-c90d203684c3%2FUntitled.png%3Fid%3D8d42cd99-c5d0-4b85-acc4-e4ec4dd1c057%26table%3Dblock%26spaceId%3De1c5ba0e-562a-49b0-8505-ce5e38fc061b%26expirationTimestamp%3D1722088800000%26signature%3DYKZFSReZUbNMM9Yii4tuUMsCPnK1LyW7rKXML4HmHCI?table=block&id=8d42cd99-c5d0-4b85-acc4-e4ec4dd1c057&cache=v2)
The degree of freedom (deg) is the number of knots in the natural spline model.
- For each sample, the R2 increases as deg increases.
- The fitted curve is more flexible as deg increases. Deg 10 appears to capture the true model shape better.
Generalized Additive Models
It is just an AUTOMATED version of Spline.
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fe1c5ba0e-562a-49b0-8505-ce5e38fc061b%2F71d5b474-429c-4f3a-ac1d-55f4bd2919d3%2FUntitled.png%3Fid%3D153cb188-a65c-4656-a13f-926aef5a8835%26table%3Dblock%26spaceId%3De1c5ba0e-562a-49b0-8505-ce5e38fc061b%26expirationTimestamp%3D1722088800000%26signature%3D-L5YMfveOStAuLRAbMNPHSjUpAq4_J2FqkmuCgdyPPM?table=block&id=153cb188-a65c-4656-a13f-926aef5a8835&cache=v2)
Assumption (Further here)
2'. Homogeneity of variance (Similar variance)
3'. Normality of residuals
FAQ
Reference
Extra Resource
- Author:Jason Siu
- URL:https://jason-siu.com/article%2Fcae2c463-b61b-4a67-b833-0063da3f9943
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts