+ - 0:00:00
Notes for current slide
Notes for next slide

Wrap-up

Dr. D’Agostino McGowan

1 / 22

What have we learned?

2 / 22

What have we learned?

  • Supervised learning techniques
2 / 22

What have we learned?

  • Supervised learning techniques
  • Focused on prediction
2 / 22

What have we learned?

  • Supervised learning techniques
  • Focused on prediction
  • bias-variance trade-off
2 / 22

How do we ensure that we aren't overfitting?

  • We tune using an estimate of the test error and find the model that minimizes this
3 / 22

How do we ensure that we aren't overfitting?

  • We tune using an estimate of the test error and find the model that minimizes this

How do we estimate the test error?

  • Cross-validation
  • Validation Set
  • A combination of both
3 / 22

Types of models

  • Regression
  • Classification
4 / 22

Regression

  • Linear Regression
5 / 22

Regression

  • Linear Regression
    • Ridge
    • Lasso
    • Elastic net
5 / 22

Regression

  • Linear Regression
    • Ridge
    • Lasso
    • Elastic net
  • Regression Trees
5 / 22

Regression

  • Linear Regression
    • Ridge
    • Lasso
    • Elastic net
  • Regression Trees
  • Ensemble Trees
    • Bagged Trees
    • Random Forest
    • Boosted Trees
5 / 22

tidymodels

library(tidymodels)
6 / 22

Linear Regression in R

mod_spec <- linear_reg() %>%
set_engine("lm")
mod_spec
## Linear Regression Model Specification (regression)
##
## Computational engine: lm
7 / 22

Ridge Regression in R

mod_spec <- linear_reg(penalty = 10, mixture = 0) %>%
set_engine("glmnet")
mod_spec
## Linear Regression Model Specification (regression)
##
## Main Arguments:
## penalty = 10
## mixture = 0
##
## Computational engine: glmnet
8 / 22

Lasso in R

mod_spec <- linear_reg(penalty = 10, mixture = 1) %>%
set_engine("glmnet")
mod_spec
## Linear Regression Model Specification (regression)
##
## Main Arguments:
## penalty = 10
## mixture = 1
##
## Computational engine: glmnet
9 / 22

Elastic net in R

mod_spec <- linear_reg(penalty = 10, mixture = 0.5) %>%
set_engine("glmnet")
mod_spec
## Linear Regression Model Specification (regression)
##
## Main Arguments:
## penalty = 10
## mixture = 0.5
##
## Computational engine: glmnet
10 / 22

Regression Trees in R

mod_spec <- decision_tree(mode = "regression") %>%
set_engine("rpart")
mod_spec
## Decision Tree Model Specification (regression)
##
## Computational engine: rpart
11 / 22

Bagging in R

mod_spec <- rand_forest(
mode = "regression",
mtry = 10) %>%
set_engine("ranger")
mod_spec
## Random Forest Model Specification (regression)
##
## Main Arguments:
## mtry = 10
##
## Computational engine: ranger
12 / 22

Random Forest in R

mod_spec <- rand_forest(
mode = "regression") %>%
set_engine("ranger")
mod_spec
## Random Forest Model Specification (regression)
##
## Computational engine: ranger
13 / 22

Boosting in R

mod_spec <- boost_tree(
mode = "regression") %>%
set_engine("xgboost")
mod_spec
## Boosted Tree Model Specification (regression)
##
## Computational engine: xgboost
14 / 22

Classification

  • Logistic Regression
15 / 22

Classification

  • Logistic Regression
    • Ridge
    • Lasso
    • Elastic net
15 / 22

Classification

  • Logistic Regression
    • Ridge
    • Lasso
    • Elastic net
  • Classification Trees
15 / 22

Classification

  • Logistic Regression
    • Ridge
    • Lasso
    • Elastic net
  • Classification Trees
  • Ensemble Trees
    • Bagged Trees
    • Random Forest
    • Boosted Trees
15 / 22

Logistic Regression in R

mod_spec <- logistic_reg() %>%
set_engine("glm")
mod_spec
## Logistic Regression Model Specification (classification)
##
## Computational engine: glm
16 / 22

Ridge (Logistic) in R

mod_spec <- logistic_reg(penalty = 10, mixture = 0) %>%
set_engine("glmnet")
mod_spec
## Logistic Regression Model Specification (classification)
##
## Main Arguments:
## penalty = 10
## mixture = 0
##
## Computational engine: glmnet
17 / 22

Lasso (Logistic) in R

mod_spec <- logistic_reg(penalty = 10, mixture = 1) %>%
set_engine("glmnet")
mod_spec
## Logistic Regression Model Specification (classification)
##
## Main Arguments:
## penalty = 10
## mixture = 1
##
## Computational engine: glmnet
18 / 22

Elastic net (Logistic) in R

mod_spec <- logistic_reg(penalty = 10, mixture = 0.5) %>%
set_engine("glmnet")
mod_spec
## Logistic Regression Model Specification (classification)
##
## Main Arguments:
## penalty = 10
## mixture = 0.5
##
## Computational engine: glmnet
19 / 22

Bagging in R

mod_spec <- rand_forest(
mode = "classification",
mtry = 10) %>%
set_engine("ranger")
mod_spec
## Random Forest Model Specification (classification)
##
## Main Arguments:
## mtry = 10
##
## Computational engine: ranger
20 / 22

Random Forest in R

mod_spec <- rand_forest(
mode = "classification") %>%
set_engine("ranger")
mod_spec
## Random Forest Model Specification (classification)
##
## Computational engine: ranger
21 / 22

Boosting in R

mod_spec <- boost_tree(
mode = "classification") %>%
set_engine("xgboost")
mod_spec
## Boosted Tree Model Specification (classification)
##
## Computational engine: xgboost
22 / 22

What have we learned?

2 / 22
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow