Skip to content

Commit

Permalink
Use full names for sensitivity, specificity. Closes #66.
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasilge committed Aug 22, 2021
1 parent c5e4de4 commit 1962090
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion chapters/chapter3.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ The workflow `vote_wf` contains both the recipe and the model specification, and
**Instructions**

- Now fit the resamples `vote_folds` to the random forest model.
- Compute the metrics `roc_auc`, `sens`, and `spec`.
- Compute the metrics `roc_auc`, `sensitivity`, and `specificity`.

<codeblock id="03_14_2">

Expand Down
2 changes: 1 addition & 1 deletion exercises/exc_03_14_1.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set.seed(234)
glm_res <- vote_wf %>%
___(
vote_folds,
metrics = metric_set(roc_auc, sens, spec),
metrics = metric_set(roc_auc, sensitivity, specificity),
control = control_resamples(save_pred = TRUE)
)

Expand Down
2 changes: 1 addition & 1 deletion exercises/solution_03_14_1.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set.seed(234)
glm_res <- vote_wf %>%
fit_resamples(
vote_folds,
metrics = metric_set(roc_auc, sens, spec),
metrics = metric_set(roc_auc, sensitivity, specificity),
control = control_resamples(save_pred = TRUE)
)

Expand Down
2 changes: 1 addition & 1 deletion exercises/solution_03_14_2.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set.seed(234)
rf_res <- vote_wf %>%
fit_resamples(
vote_folds,
metrics = metric_set(roc_auc, sens, spec),
metrics = metric_set(roc_auc, sensitivity, specificity),
control = control_resamples(save_pred = TRUE)
)

Expand Down
4 changes: 2 additions & 2 deletions slides/chapter3_13.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ Let's talk about that model performance now, how to set _non-default performance
vote_wf %>%
fit_resamples(
vote_folds,
metrics = metric_set(roc_auc, sens, spec),
metrics = metric_set(roc_auc, sensitivity, specificity),
control = control_resamples(save_pred = TRUE)
)
```

Notes: Just like in our first case study, we can use the function `fit_resamples()` to fit a model (a workflow in this case, actually, that holds both a preprocessor and a model specification) to each cross-validation fold and compute performance metrics. The code shown on this slide will fit our workflow `vote_wf` to the cross-validation folds in `vote_folds` and determine how well the model performed each time.

The fitted models themselves are not kept or stored because they are only used for computing performance metrics. However, we are saving the predictions with `save_pred = TRUE` so we can build a confusion matrix, and we have also set _specific performance metrics_ to be computed (instead of the defaults) with `metric_set(roc_auc, sens, spec)`. We will have:
The fitted models themselves are not kept or stored because they are only used for computing performance metrics. However, we are saving the predictions with `save_pred = TRUE` so we can build a confusion matrix, and we have also set _specific performance metrics_ to be computed (instead of the defaults) with `metric_set(roc_auc, sensitivity, specificity)`. We will have:

- the area under the ROC curve,
- sensitivity, and
Expand Down

0 comments on commit 1962090

Please sign in to comment.