Beyond Linearity Flashcards
What are some predictive models that move beyond linearity?
- Polynomial Functions
- Step Functions - break X into bins, create an ordered categorical variable
- Piecewwise Polynomilas - fit a different polynomial function to different bins, instead of just different coefficients in each bin (2).
- Splines - piecewise polynomials that yield a function that is continous across bins.
Things you have to worry about w/splines
you have to pick the number of knots, or bins using cross validation. You could choose the location of the knots, but usually just go w/uniform if you dont know.
Splines vs Polynomial
Splines usually better, b/c fit lower order polynomial across bins, whereas polynomial must use a higher order polynomial to achieve same effect.
Smoothing Spline
Just like splines, but add a penalty or regularization parameters that awards “smoothness”, uses the 2nd derivative.
Local Regression
Regression Done iratievely on local values of X, by weighting locally close values higher and far away values almost close to zero. Results in a sort of “moving average regression”. You have to choose the span, or S which is the number of local data points to consider.
Consideration of Local Regession
susceptable to high-dimensionality, because lie KNN, in high dimensional space there may be few local data points. Doesn’t usually work if p >4.
Generalized Additive Models
Allows you to fit a separate non linear function to each X.
Advantages of GAM
- Can fit non linear functions to each X
- Potentially more accurate predictions
- Model is additive, so each effect of X is determined by holding all other vars constant. This means easy to interpret model resutls.