Skip to content

Commit

Permalink
give big-picture @description for each adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Sep 13, 2024
1 parent 2239aed commit 8eee497
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 5 deletions.
5 changes: 5 additions & 0 deletions R/adjust-equivocal-zone.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#' Apply an equivocal zone to a binary classification model.
#'
#' Equivocal zones describe intervals of predicted probabilities that are deemed
#' too uncertain or ambiguous to be assigned a hard class. Rather than
#' predicting a hard class when the probability is very close to a threshold,
#' tailors using this adjustment predict "\[EQ\]".
#'
#' @param x A [tailor()].
#' @param value A numeric value (between zero and 1/2) or [hardhat::tune()]. The
#' value is the size of the buffer around the threshold.
Expand Down
7 changes: 7 additions & 0 deletions R/adjust-numeric-range.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#' Truncate the range of numeric predictions
#'
#' @description
#' Truncating ranges involves limiting the output of a model to a specific
#' range of values, typically to avoid extreme or unrealistic predictions.
#' This technique can help improve the practical applicability of a model's
#' outputs by constraining them within reasonable bounds based on domain
#' knowledge or physical limitations.
#'
#' @param x A [tailor()].
#' @param upper_limit,lower_limit A numeric value, NA (for no truncation) or
#' [hardhat::tune()].
Expand Down
3 changes: 3 additions & 0 deletions R/adjust-predictions-custom.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#' Change or add variables
#'
#' This adjustment functions allows for arbitrary transformations of model
#' predictions using [dplyr::mutate()] statements.
#'
#' @param x A [tailor()].
#' @param .pkgs A character string of extra packages that are needed to execute
#' the commands.
Expand Down
7 changes: 7 additions & 0 deletions R/adjust-probability-calibration.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#' Re-calibrate classification probability predictions
#'
#' @description
#' Calibration is the process of adjusting a model's outputted probabilities
#' to match the observed frequencies of events. This technique aims to
#' ensure that when a model predicts a certain probability for an outcome,
#' that probability accurately reflects the true likelihood of that outcome
#' occurring.
#'
#' @param x A [tailor()].
#' @param method Character. One of `"logistic"`, `"multinomial"`,
#' `"beta"`, `"isotonic"`, or `"isotonic_boot"`, corresponding to the
Expand Down
10 changes: 10 additions & 0 deletions R/adjust-probability-threshold.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#' Change the event threshold
#'
#' @description
#' Many machine learning systems determine hard class predictions by
#' first predicting the probability of an event and then predicting that
#' an event will occur if its respective probability is above 0.5. This
#' adjustment allows practitioners to determine hard class predictions using
#' a threshold other than 0.5. By setting appropriate thresholds, one can
#' balance the trade-off between different types of errors (such as
#' false positives and false negatives) to optimize the model's performance
#' for specific use cases.
#'
#' @param x A [tailor()].
#' @param threshold A numeric value (between zero and one) or [hardhat::tune()].
#' @examplesIf rlang::is_installed("modeldata")
Expand Down
5 changes: 4 additions & 1 deletion man/adjust_equivocal_zone.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/adjust_numeric_range.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/adjust_predictions_custom.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/adjust_probability_calibration.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion man/adjust_probability_threshold.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8eee497

Please sign in to comment.