Skip to content

Commit 865e18f

Browse files
authored
Merge pull request #947 from tidymodels/fix_xy-rpart-censored
remove stopper on `fit_xy()` for censored regression
2 parents b6fe7fc + 033cf0e commit 865e18f

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

NAMESPACE

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ S3method(extract_parameter_dials,model_spec)
1111
S3method(extract_parameter_set_dials,model_spec)
1212
S3method(extract_spec_parsnip,model_fit)
1313
S3method(fit,model_spec)
14-
S3method(fit_xy,decision_tree)
1514
S3method(fit_xy,gen_additive_mod)
1615
S3method(fit_xy,model_spec)
1716
S3method(glance,model_fit)

R/decision_tree.R

-21
Original file line numberDiff line numberDiff line change
@@ -135,27 +135,6 @@ check_args.decision_tree <- function(object) {
135135

136136
# ------------------------------------------------------------------------------
137137

138-
#' @export
139-
fit_xy.decision_tree <- function(object,
140-
x,
141-
y,
142-
case_weights = NULL,
143-
control = parsnip::control_parsnip(),
144-
...) {
145-
146-
if (object$mode == "censored regression" && object$engine == "rpart") {
147-
# prodlim::EventHistory.frame() expects a call to `Surv()` (or `Hist()`) on
148-
# the left-hand side of the formula
149-
rlang::abort("For the `'rpart'` engine, please use the formula interface via `fit()`.")
150-
}
151-
152-
# call parsnip::fit_xy.model_spec()
153-
res <- NextMethod()
154-
res
155-
}
156-
157-
# ------------------------------------------------------------------------------
158-
159138
#' Decision trees via rpart
160139
#'
161140
#' `rpart_train` is a wrapper for `rpart()` tree-based models

0 commit comments

Comments
 (0)