Skip to content

Commit 948308b

Browse files
topepo‘topepo’
andauthored
export and document case_weights_allowed (#1046)
* export and document case_weights_allowed * missing pkgdown entry --------- Co-authored-by: ‘topepo’ <‘mxkuhn@gmail.com’>
1 parent 3fb23ca commit 948308b

File tree

6 files changed

+38
-3
lines changed

6 files changed

+38
-3
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ Config/testthat/edition: 3
7676
Encoding: UTF-8
7777
LazyData: true
7878
Roxygen: list(markdown = TRUE)
79-
RoxygenNote: 7.2.3.9000
79+
RoxygenNote: 7.2.3

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export(bag_tree)
178178
export(bart)
179179
export(bartMachine_interval_calc)
180180
export(boost_tree)
181+
export(case_weights_allowed)
181182
export(cforest_train)
182183
export(check_empty_ellipse)
183184
export(check_final_param)

R/case_weights.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ patch_formula_environment_with_case_weights <- function(formula,
6767

6868
# ------------------------------------------------------------------------------
6969

70+
#' Determine if case weights are used
71+
#'
72+
#' Not all modeling engines can incorporate case weights into their
73+
#' calculations. This function can determine whether they can be used.
74+
#'
75+
#' @param spec A parsnip model specification.
76+
#' @return A single logical.
77+
#' @examples
78+
#' case_weights_allowed(linear_reg())
79+
#' case_weights_allowed(linear_reg(engine = "keras"))
80+
#' @export
7081
case_weights_allowed <- function(spec) {
7182
mod_type <- class(spec)[1]
7283
mod_eng <- spec$engine

_pkgdown.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ reference:
7171
- add_rowindex
7272
- augment.model_fit
7373
- case_weights
74+
- case_weights_allowed
7475
- descriptors
7576
- extract-parsnip
7677
- fit.model_spec

man/case_weights_allowed.Rd

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/glmnet-details.Rd

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

0 commit comments

Comments
 (0)