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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3.9000
RoxygenNote: 7.2.3
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export(bag_tree)
export(bart)
export(bartMachine_interval_calc)
export(boost_tree)
export(case_weights_allowed)
export(cforest_train)
export(check_empty_ellipse)
export(check_final_param)
Expand Down
11 changes: 11 additions & 0 deletions R/case_weights.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ patch_formula_environment_with_case_weights <- function(formula,

# ------------------------------------------------------------------------------

#' Determine if case weights are used
#'
#' Not all modeling engines can incorporate case weights into their
#' calculations. This function can determine whether they can be used.
#'
#' @param spec A parsnip model specification.
#' @return A single logical.
#' @examples
#' case_weights_allowed(linear_reg())
#' case_weights_allowed(linear_reg(engine = "keras"))
#' @export
case_weights_allowed <- function(spec) {
mod_type <- class(spec)[1]
mod_eng <- spec$engine
Expand Down
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ reference:
- add_rowindex
- augment.model_fit
- case_weights
- case_weights_allowed
- descriptors
- extract-parsnip
- fit.model_spec
Expand Down
22 changes: 22 additions & 0 deletions man/case_weights_allowed.Rd

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

4 changes: 2 additions & 2 deletions man/glmnet-details.Rd

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