From 9a2b1142eaa38406610e326df14a219452a381cd Mon Sep 17 00:00:00 2001 From: Hannah Frick Date: Wed, 9 Nov 2022 09:32:17 +0000 Subject: [PATCH 1/2] remove stop gap for aorsf since the fix has now been released --- DESCRIPTION | 2 +- NAMESPACE | 1 - R/rand_forest.R | 21 --------------------- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 79d3d2f1f..f75704605 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: parsnip Title: A Common API to Modeling and Analysis Functions -Version: 1.0.2.9004 +Version: 1.0.2.9005 Authors@R: c( person("Max", "Kuhn", , "max@rstudio.com", role = c("aut", "cre")), person("Davis", "Vaughan", , "davis@rstudio.com", role = "aut"), diff --git a/NAMESPACE b/NAMESPACE index a64bb4d0e..77a011c37 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -9,7 +9,6 @@ S3method(fit,model_spec) S3method(fit_xy,decision_tree) S3method(fit_xy,gen_additive_mod) S3method(fit_xy,model_spec) -S3method(fit_xy,rand_forest) S3method(glance,model_fit) S3method(has_multi_predict,default) S3method(has_multi_predict,model_fit) diff --git a/R/rand_forest.R b/R/rand_forest.R index 4880d4464..9007b1469 100644 --- a/R/rand_forest.R +++ b/R/rand_forest.R @@ -164,24 +164,3 @@ check_args.rand_forest <- function(object) { invisible(object) } -# ------------------------------------------------------------------------------ - -#' @export -fit_xy.rand_forest <- function(object, - x, - y, - case_weights = NULL, - control = parsnip::control_parsnip(), - ...) { - - if (object$mode == "censored regression" && object$engine == "aorsf") { - # CRAN aorsf::orsf() requires two variables on the left-hand side of the formula, - # either in as `Surv(time, status) ~ .` or as `time + status ~ .` - # see https://github.com/ropensci/aorsf/issues/11 - rlang::abort("For the `'aorsf'` engine, please use the formula interface via `fit()`.") - } - - # call parsnip::fit_xy.model_spec() - res <- NextMethod() - res -} From e9bfe6724f7cbc49c4ed8b4ea52dc962d937a214 Mon Sep 17 00:00:00 2001 From: Hannah Frick Date: Wed, 9 Nov 2022 09:32:32 +0000 Subject: [PATCH 2/2] documentation --- man/details_rand_forest_aorsf.Rd | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/man/details_rand_forest_aorsf.Rd b/man/details_rand_forest_aorsf.Rd index 34c96c3f3..f3fdfca46 100644 --- a/man/details_rand_forest_aorsf.Rd +++ b/man/details_rand_forest_aorsf.Rd @@ -29,6 +29,8 @@ p-value of 0.05. } } \section{Translation from parsnip to the original package (censored regression)}{ +The \strong{censored} extension package is required to fit this model. + \if{html}{\out{
}}\preformatted{library(censored) rand_forest() \%>\% @@ -52,6 +54,16 @@ Categorical predictors can be partitioned into groups of factor levels are not required for this model. } +\subsection{Case weights}{ + +This model can utilize case weights during model fitting. To use them, +see the documentation in \link{case_weights} and the examples +on \code{tidymodels.org}. + +The \code{fit()} and \code{fit_xy()} arguments have arguments called +\code{case_weights} that expect vectors of case weights. +} + \subsection{Other details}{ Predictions of survival probability at a time exceeding the maximum