Skip to content

Commit

Permalink
Merge pull request #213 from tidymodels/move-.censoring_weights_graf.…
Browse files Browse the repository at this point in the history
…workflow

Move .censoring weights graf.workflow
  • Loading branch information
EmilHvitfeldt authored Dec 13, 2023
2 parents a73a19d + 895b055 commit b841ff0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: workflows
Title: Modeling Workflows
Version: 1.1.3.9000
Version: 1.1.3.9001
Authors@R: c(
person("Davis", "Vaughan", , "[email protected]", role = "aut"),
person("Simon", "Couch", , "[email protected]", role = c("aut", "cre"),
Expand All @@ -24,7 +24,7 @@ Imports:
hardhat (>= 1.2.0),
lifecycle (>= 1.0.3),
modelenv (>= 0.1.0),
parsnip (>= 1.1.1.9004),
parsnip (>= 1.1.1.9007),
rlang (>= 1.0.3),
tidyselect (>= 1.2.0),
vctrs (>= 0.4.1)
Expand All @@ -51,4 +51,4 @@ Remotes:
Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.2.3.9000
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method(.censoring_weights_graf,workflow)
S3method(augment,workflow)
S3method(extract_fit_engine,workflow)
S3method(extract_fit_parsnip,workflow)
Expand Down Expand Up @@ -68,5 +69,6 @@ importFrom(hardhat,extract_preprocessor)
importFrom(hardhat,extract_recipe)
importFrom(hardhat,extract_spec_parsnip)
importFrom(lifecycle,deprecated)
importFrom(parsnip,.censoring_weights_graf)
importFrom(parsnip,fit_xy)
importFrom(stats,predict)
10 changes: 10 additions & 0 deletions R/survival-censoring-weights.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#' @export
.censoring_weights_graf.workflow <- function(object,
predictions,
cens_predictors = NULL,
trunc = 0.05, eps = 10^-10, ...) {
if (is.null(object$fit$fit)) {
rlang::abort("The workflow does not have a model fit object.")
}
.censoring_weights_graf(object$fit$fit, predictions, cens_predictors, trunc, eps)
}
1 change: 1 addition & 0 deletions R/workflows-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#' @importFrom generics tune_args
#' @importFrom generics tunable
#' @importFrom lifecycle deprecated
#' @importFrom parsnip .censoring_weights_graf
#' @importFrom parsnip fit_xy
#' @importFrom stats predict
## usethis namespace: end
Expand Down

0 comments on commit b841ff0

Please sign in to comment.