Chapter 7 Moving Beyond Linearity
Learning objectives:
Model relationships between a predictor and an outcome with
- polynomial regression
 - step functions
 - regression splines
 - smoothing splines
 - local regression
 - generalized additive models
 
Chapter 7 resources:
- The text at https://www.statlearning.com/
 - Cohort 1 videos
 - Author videos
 - Author slides
 - Emil Hvitfeldt’s 
Tidymodelsexamples - Kim Larsen’s GAM: The Predictive Modeling Silver Bullet
 - Noam Ross’ GAMs in R: A Free, Interactive Course using mgcv
 - onmee’s ISLR solutions for Chapter 7
 
Black motorcycle parked at road toward mountain
suppressPackageStartupMessages({
  library(splines)
  library(tidymodels)
  
  library(ISLR)
  library(boot)
  library(MASS)
  library(leaps)
  library(gam)
  library(ggplot2)
})
tidymodels_prefer()
#require(caTools)
attach(Wage)
attach(Auto)## The following object is masked from Wage:
## 
##     year
## The following object is masked from package:lubridate:
## 
##     origin
## The following object is masked from package:ggplot2:
## 
##     mpg