Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
apreshill committed May 2, 2020
1 parent 574a9b9 commit 94f24bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion materials/exercises/04-Ensembling.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Compare the metrics of the random forest to your two single tree models (vanilla

# Your Turn 6

Challenge: Make 4 more random forest model specs, each using 4, 8, 12, and 20 variables at each split. Which value maximizes the area under the ROC curve?
Challenge: Make 4 more random forest model specs, each using 4, 8, 12, and 19 variables at each split. Which value maximizes the area under the ROC curve?

*Hint: you'll need https://tidymodels.github.io/parsnip/reference/rand_forest.html*

Expand Down
10 changes: 6 additions & 4 deletions materials/exercises/06-case-study/random-forest.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ val_set <- validation_split(hotel_other,
# specify un-tuned parsnip model------------------------------------------------
# EDIT ME TO TUNE!==============================================================
rf_spec <-
rand_forest(trees = 1000) %>%
rand_forest(mtry = tune(), min_n = tune()) %>%
set_engine("ranger") %>%
set_mode("classification")

Expand All @@ -41,11 +41,13 @@ rf_workflow <-
add_model(rf_spec) %>%
add_recipe(rf_recipe)

rf_grid <- expand_grid(mtry = c(1, 5, 10), min_n = c(10, 20, 30))
# train/tune--------------------------------------------------------------------
set.seed(345)
# EDIT ME TO TUNE!==============================================================
rf_results <-
rf_workflow %>%
fit_resamples(resamples = val_set,
control = control_resamples(save_pred = TRUE),
metrics = metric_set(roc_auc))
tune_grid(resamples = val_set,
grid = rf_grid,
control = control_grid(save_pred = TRUE),
metrics = metric_set(roc_auc))

0 comments on commit 94f24bf

Please sign in to comment.