diff --git a/DESCRIPTION b/DESCRIPTION index da3fb6d89..6e67909aa 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: parsnip Title: A Common API to Modeling and Analysis Functions -Version: 1.1.1.9008 +Version: 1.2.0 Authors@R: c( person("Max", "Kuhn", , "max@posit.co", role = c("aut", "cre")), person("Davis", "Vaughan", , "davis@posit.co", role = "aut"), @@ -17,7 +17,7 @@ URL: https://github.com/tidymodels/parsnip, https://parsnip.tidymodels.org/ BugReports: https://github.com/tidymodels/parsnip/issues Depends: - R (>= 3.5) + R (>= 3.6) Imports: cli, dplyr (>= 1.1.0), @@ -76,4 +76,4 @@ Config/testthat/edition: 3 Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.0 +RoxygenNote: 7.3.1 diff --git a/NAMESPACE b/NAMESPACE index b2bede299..869e2a030 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -76,6 +76,7 @@ S3method(predict_linear_pred,model_fit) S3method(predict_numeric,"_elnet") S3method(predict_numeric,"_glmnetfit") S3method(predict_numeric,model_fit) +S3method(predict_predint,model_fit) S3method(predict_quantile,model_fit) S3method(predict_raw,"_elnet") S3method(predict_raw,"_glmnetfit") @@ -283,12 +284,15 @@ export(pred_value_template) export(predict.model_fit) export(predict_class.model_fit) export(predict_classprob.model_fit) +export(predict_confint) export(predict_confint.model_fit) export(predict_hazard.model_fit) export(predict_linear_pred) export(predict_linear_pred.model_fit) export(predict_numeric) export(predict_numeric.model_fit) +export(predict_predint) +export(predict_predint.model_fit) export(predict_quantile.model_fit) export(predict_raw) export(predict_raw.model_fit) diff --git a/NEWS.md b/NEWS.md index 5627e18ed..002084d8d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,33 +1,38 @@ -# parsnip (development version) +# parsnip 1.2.0 -* We no longer add `eval_time` arguments to the prediction specification for the engine (#1039). - -* parsnip now lets the engines for [mlp()] check for acceptable values of the activation function (#1019) +## Bug Fixes * Tightened logic for outcome checking. This resolves issues—some errors and some silent failures—when atomic outcome variables have an attribute (#1060, #1061). -* `rpart_train()` has been deprecated in favor of using `decision_tree()` with the `"rpart"` engine or `rpart::rpart()` directly (#1044). - * Fixed bug in fitting some model types with the `"spark"` engine (#1045). * Fixed issues in metadata for the `"brulee"` engine where several arguments were mistakenly protected. (#1050, #1054) +* Fixed documentation for `mlp(engine = "brulee")`: the default values for `learn_rate` and `epochs` were swapped (#1018). + +* Fixed a bug in the integration with workflows where using a model formula with a formula preprocessor could result in a double intercept (#1033). + +## Other Changes + +* We no longer add `eval_time` arguments to the prediction specification for the engine (#1039). + +* parsnip now lets the engines for [mlp()] check for acceptable values of the activation function (#1019) + +* `rpart_train()` has been deprecated in favor of using `decision_tree()` with the `"rpart"` engine or `rpart::rpart()` directly (#1044). + * `.filter_eval_time()` was moved to the survival standalone file. * Improved errors and documentation related to special terms in formulas. See `?model_formula` to learn more. (#770, #1014) * Improved errors in cases where the outcome column is mis-specified. (#1003) -* Fixed documentation for `mlp(engine = "brulee")`: the default values for `learn_rate` and `epochs` were swapped (#1018). - * The `new_data` argument for the `predict()` method for `censoring_model_reverse_km` objects has been deprecated (#965). * When computing censoring weights, the resulting vectors are no longer named (#1023). -* Fixed a bug in the integration with workflows where using a model formula with a formula preprocessor could result in a double intercept (#1033). - * The `predict()` method for `censoring_model_reverse_km` objects now checks that `...` are empty (#1029). + # parsnip 1.1.1 * Fixed bug where prediction on rank deficient `lm()` models produced `.pred_res` instead of `.pred`. (#985) diff --git a/R/engine_docs.R b/R/engine_docs.R index 0ad656167..4806f2754 100644 --- a/R/engine_docs.R +++ b/R/engine_docs.R @@ -7,6 +7,10 @@ #' @keywords internal #' @export knit_engine_docs <- function(pattern = NULL) { + old_cli_opt <- options()$cli.unicode + on.exit(options(cli.unicode = old_cli_opt)) + options(cli.unicode = FALSE) + rmd_files <- list.files("man/rmd", pattern = "\\.Rmd", full.names = TRUE) if (!is.null(pattern)) { diff --git a/R/predict_interval.R b/R/predict_interval.R index 018228cdd..4595c1551 100644 --- a/R/predict_interval.R +++ b/R/predict_interval.R @@ -40,21 +40,29 @@ predict_confint.model_fit <- function(object, new_data, level = 0.95, std_error res } -# @export -# @keywords internal -# @rdname other_predict -# @inheritParams predict.model_fit +#' @export +#' @keywords internal +#' @rdname other_predict +#' @inheritParams predict.model_fit predict_confint <- function(object, ...) UseMethod("predict_confint") # ------------------------------------------------------------------------------ -# @keywords internal -# @rdname other_predict -# @inheritParams predict.model_fit -# @method predict_predint model_fit -# @export predict_predint.model_fit -# @export +#' @export +#' @keywords internal +#' @rdname other_predict +#' @inheritParams predict.model_fit +predict_predint <- function(object, ...) + UseMethod("predict_predint") + + +#' @keywords internal +#' @rdname other_predict +#' @inheritParams predict.model_fit +#' @method predict_predint model_fit +#' @export predict_predint.model_fit +#' @export predict_predint.model_fit <- function(object, new_data, level = 0.95, std_error = FALSE, ...) { check_spec_pred_type(object, "pred_int") @@ -88,10 +96,10 @@ predict_predint.model_fit <- function(object, new_data, level = 0.95, std_error res } -# @export -# @keywords internal -# @rdname other_predict -# @inheritParams predict.model_fit +#' @export +#' @keywords internal +#' @rdname other_predict +#' @inheritParams predict.model_fit predict_predint <- function(object, ...) UseMethod("predict_predint") diff --git a/R/surv_reg_flexsurv.R b/R/surv_reg_flexsurv.R deleted file mode 100644 index 39404798f..000000000 --- a/R/surv_reg_flexsurv.R +++ /dev/null @@ -1,9 +0,0 @@ -#' Parametric survival regression -#' -#' [flexsurv::flexsurvreg()] fits a parametric survival model. -#' -#' @includeRmd man/rmd/surv_reg_flexsurv.md details -#' -#' @name details_surv_reg_flexsurv -#' @keywords internal -NULL diff --git a/R/surv_reg_survival.R b/R/surv_reg_survival.R deleted file mode 100644 index e4b24a35d..000000000 --- a/R/surv_reg_survival.R +++ /dev/null @@ -1,9 +0,0 @@ -#' Parametric survival regression -#' -#' [survival::survreg()] fits a parametric survival model. -#' -#' @includeRmd man/rmd/surv_reg_survival.md details -#' -#' @name details_surv_reg_survival -#' @keywords internal -NULL diff --git a/man/details_gen_additive_mod_mgcv.Rd b/man/details_gen_additive_mod_mgcv.Rd index db9f55eab..b8bc31f32 100644 --- a/man/details_gen_additive_mod_mgcv.Rd +++ b/man/details_gen_additive_mod_mgcv.Rd @@ -94,8 +94,8 @@ using \code{s(x, df = 10)}) in the formula. Tuning can be accomplished using the \code{adjust_deg_free} parameter. When using a workflow, pass the \emph{model formula} to -\code{\link[=add_model]{add_model()}}’s \code{formula} argument, and a simplified -\emph{preprocessing formula} elsewhere. +\code{\link[workflows:add_model]{workflows::add_model()}}’s \code{formula} argument, +and a simplified \emph{preprocessing formula} elsewhere. \if{html}{\out{