Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# hardhat (development version)

* Added more documentation about importance and frequency weights in
`?importance_weights()` and `?frequency_weights()` (#214).

# hardhat 1.2.0

* We have reverted the change made in hardhat 1.0.0 that caused recipe
Expand Down
17 changes: 17 additions & 0 deletions R/case-weights.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
#' are supplied as a non-negative double vector, where fractional values are
#' allowed.
#'
#' @details
#' Importance weights focus on how much each row of the data set should
#' influence model estimation. These can be based on data or arbitrarily set to
#' achieve some goal.
#'
#' In tidymodels, importance weights only affect the model estimation and
#' _supervised_ recipes steps. They are not used with yardstick functions for
#' calculating measures of model performance.
#'
#' @param x A double vector.
#'
#' @return A new importance weights vector.
Expand Down Expand Up @@ -117,6 +126,14 @@ vec_ptype_abbr.hardhat_importance_weights <- function(x, ...) {
#' are supplied as a non-negative integer vector, where only whole numbers are
#' allowed.
#'
#' @details
#' Frequency weights are integers that denote how many times a particular row of
#' the data has been observed. They help compress redundant rows into a single
#' entry.
#'
#' In tidymodels, frequency weights are used for all parts of the preprocessing,
#' model fitting, and performance estimation operations.
#'
#' @param x An integer vector.
#'
#' @return A new frequency weights vector.
Expand Down
8 changes: 8 additions & 0 deletions man/frequency_weights.Rd

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

9 changes: 9 additions & 0 deletions man/importance_weights.Rd

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