Moving Beyond Linearity — ISLR Series Chapter 7

Photo by Ryan Stone on Unsplash

Polynomial Regression

A simple linear model looks like this:

(source: ISLR)
(source: ISLR)
(source: ISLR)
(source: ISLR)

Stepwise Regression

The concept behind stepwise functions is to divide the features into bins. And for each bin, multiply a different coefficient and a different constant, C.

(source: ISLR)
(source: ISLR)
(source: ISLR)

Regression Splines

Another alternative is to use piecewise polynomials. We can think of piecewise polynomials as a combination of stepwise and polynomial regression in that it divides the features into regions (similar to stepwise) and then apply a different polynomial to each of that region (polynomial regression). This is different from polynomial regression because polynomial regression applies a polynomial function to the ENTIRE data. This is different from a stepwise regression because it applies a function in each of the regions instead of just a constant. An example of a piecewise polynomial regression that separates the features into two regions is below:

(source: ISLR)

Generalized Additive Models

Generalized Additive Models or GAMs sums (pun intended) up all these functions into one family of models. Previously we were discussing single features but what if we had multiple features? GAMs solves this issue by maintaining additivity linear models. As a reminder, additivity just states that the target is a sum of each of the features. The following is a typical model format that a GAM follows:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store