Skip to content

Commit 8eee497

Browse files
committed
give big-picture @description for each adjustment
1 parent 2239aed commit 8eee497

10 files changed

+56
-5
lines changed

R/adjust-equivocal-zone.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#' Apply an equivocal zone to a binary classification model.
22
#'
3+
#' Equivocal zones describe intervals of predicted probabilities that are deemed
4+
#' too uncertain or ambiguous to be assigned a hard class. Rather than
5+
#' predicting a hard class when the probability is very close to a threshold,
6+
#' tailors using this adjustment predict "\[EQ\]".
7+
#'
38
#' @param x A [tailor()].
49
#' @param value A numeric value (between zero and 1/2) or [hardhat::tune()]. The
510
#' value is the size of the buffer around the threshold.

R/adjust-numeric-range.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#' Truncate the range of numeric predictions
22
#'
3+
#' @description
4+
#' Truncating ranges involves limiting the output of a model to a specific
5+
#' range of values, typically to avoid extreme or unrealistic predictions.
6+
#' This technique can help improve the practical applicability of a model's
7+
#' outputs by constraining them within reasonable bounds based on domain
8+
#' knowledge or physical limitations.
9+
#'
310
#' @param x A [tailor()].
411
#' @param upper_limit,lower_limit A numeric value, NA (for no truncation) or
512
#' [hardhat::tune()].

R/adjust-predictions-custom.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#' Change or add variables
22
#'
3+
#' This adjustment functions allows for arbitrary transformations of model
4+
#' predictions using [dplyr::mutate()] statements.
5+
#'
36
#' @param x A [tailor()].
47
#' @param .pkgs A character string of extra packages that are needed to execute
58
#' the commands.

R/adjust-probability-calibration.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#' Re-calibrate classification probability predictions
22
#'
3+
#' @description
4+
#' Calibration is the process of adjusting a model's outputted probabilities
5+
#' to match the observed frequencies of events. This technique aims to
6+
#' ensure that when a model predicts a certain probability for an outcome,
7+
#' that probability accurately reflects the true likelihood of that outcome
8+
#' occurring.
9+
#'
310
#' @param x A [tailor()].
411
#' @param method Character. One of `"logistic"`, `"multinomial"`,
512
#' `"beta"`, `"isotonic"`, or `"isotonic_boot"`, corresponding to the

R/adjust-probability-threshold.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
#' Change the event threshold
22
#'
3+
#' @description
4+
#' Many machine learning systems determine hard class predictions by
5+
#' first predicting the probability of an event and then predicting that
6+
#' an event will occur if its respective probability is above 0.5. This
7+
#' adjustment allows practitioners to determine hard class predictions using
8+
#' a threshold other than 0.5. By setting appropriate thresholds, one can
9+
#' balance the trade-off between different types of errors (such as
10+
#' false positives and false negatives) to optimize the model's performance
11+
#' for specific use cases.
12+
#'
313
#' @param x A [tailor()].
414
#' @param threshold A numeric value (between zero and one) or [hardhat::tune()].
515
#' @examplesIf rlang::is_installed("modeldata")

man/adjust_equivocal_zone.Rd

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/adjust_numeric_range.Rd

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/adjust_predictions_custom.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/adjust_probability_calibration.Rd

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/adjust_probability_threshold.Rd

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)