Skip to content

Commit

Permalink
RC 1.1.1 (#995)
Browse files Browse the repository at this point in the history
* version bump

* Documented arguments not in \usage

* changes for CRAN check; see Rdatatable/data.table#5658

* avoid tests on cran

* remove old checks; no longer supported in current python
  • Loading branch information
topepo authored Aug 17, 2023
1 parent e6cd72f commit fc953dd
Show file tree
Hide file tree
Showing 98 changed files with 192 additions and 170 deletions.
79 changes: 0 additions & 79 deletions .github/workflows/old-tensorflow.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: parsnip
Title: A Common API to Modeling and Analysis Functions
Version: 1.1.0.9004
Version: 1.1.1
Authors@R: c(
person("Max", "Kuhn", , "[email protected]", role = c("aut", "cre")),
person("Davis", "Vaughan", , "[email protected]", role = "aut"),
Expand Down Expand Up @@ -76,4 +76,4 @@ Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.2.3.9000
10 changes: 5 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# parsnip (development version)
# parsnip 1.1.1

* Fixed bug where sparse data was being coerced to non-sparse format doing `predict()`.
* Fixed bug where prediction on rank deficient `lm()` models produced `.pred_res` instead of `.pred`. (#985)

* `augment()` now works for censored regression models.
* Fixed bug where sparse data was being coerced to non-sparse format doing `predict()`.

* For BART models with the `dbarts` engine, `predict()` can now also return the standard error for confidence and prediction intervals (#976).

* A few censored regression helper functions were exported: `.extract_surv_status()` and `.extract_surv_time()` (#973, #980).
* `augment()` now works for censored regression models.

* Fixed bug where prediction on rank dificient `lm()` models produced `.pred_res` instead of `.pred`. (#985)
* A few censored regression helper functions were exported: `.extract_surv_status()` and `.extract_surv_time()` (#973, #980).

* Fixed bug where `boost_tree()` models couldn't be fit with 1 predictor if `validation` argument was used. (#994)

Expand Down
9 changes: 2 additions & 7 deletions R/aaa_models.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ model_info_table <-
#' @keywords internal
#' @references "How to build a parsnip model"
#' \url{https://www.tidymodels.org/learn/develop/models/}
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' # Access the model data:
#' current_code <- get_model_env()
#' ls(envir = current_code)
Expand Down Expand Up @@ -473,7 +473,6 @@ check_interface_val <- function(x) {
#' `"rand_forest"`, etc).
#' @param mode A single character string for the model mode (e.g. "regression").
#' @param eng A single character string for the model engine.
#' @param arg A single character string for the model argument name.
#' @param has_submodel A single logical for whether the argument
#' can make predictions on multiple submodels at once.
#' @param func A named character vector that describes how to call
Expand All @@ -483,10 +482,6 @@ check_interface_val <- function(x) {
#' used to invoke the usual linear regression function. In some
#' cases, it is helpful to use `c(fun = "predict")` when using a
#' package's `predict` method.
#' @param fit_obj A list with elements `interface`, `protect`,
#' `func` and `defaults`. See the package vignette "Making a
#' `parsnip` model from scratch".
#' @param pred_obj A list with elements `pre`, `post`, `func`, and `args`.
#' @param type A single character value for the type of prediction. Possible
#' values are: `class`, `conf_int`, `numeric`, `pred_int`, `prob`, `quantile`,
#' and `raw`.
Expand Down Expand Up @@ -557,7 +552,7 @@ check_interface_val <- function(x) {
#'
#' @references "How to build a parsnip model"
#' \url{https://www.tidymodels.org/learn/develop/models/}
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' # set_new_model("shallow_learning_model")
#'
#' # Show the information about a model:
Expand Down
2 changes: 1 addition & 1 deletion R/aaa_multi_predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ predict.model_spec <- function(object, ...) {
#' `multi_predict_args()` returns a character vector of argument names (or `NA`
#' if none exist).
#' @keywords internal
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' lm_model_idea <- linear_reg() %>% set_engine("lm")
#' has_multi_predict(lm_model_idea)
#' lm_model_fit <- fit(lm_model_idea, mpg ~ ., data = mtcars)
Expand Down
2 changes: 1 addition & 1 deletion R/adds.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' @param x A data frame
#' @return The same data frame with a column of 1-based integers named `.row`.
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' mtcars %>% add_rowindex()
#' @export
add_rowindex <- function(x) {
Expand Down
4 changes: 2 additions & 2 deletions R/arguments.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ check_eng_args <- function(args, obj, core_args) {
#' @return An updated model object.
#' @details `set_args()` will replace existing values of the arguments.
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' rand_forest()
#'
#' rand_forest() %>%
Expand Down Expand Up @@ -294,7 +294,7 @@ make_xy_call <- function(object, target, env) {
#' @param offset A number subtracted off of the number of rows available in the
#' data.
#' @return An integer (and perhaps a warning).
#' @examples
#' @examplesIf !parsnip:::is_cran_check()

#' nearest_neighbor(neighbors= 100) %>%
#' set_engine("kknn") %>%
Expand Down
2 changes: 1 addition & 1 deletion R/augment.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#' @references
#' \url{https://www.tidymodels.org/learn/statistics/survival-metrics/}
#' @export
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' car_trn <- mtcars[11:32,]
#' car_tst <- mtcars[ 1:10,]
#'
Expand Down
2 changes: 1 addition & 1 deletion R/bart.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#'
#' @seealso \Sexpr[stage=render,results=rd]{parsnip:::make_seealso_list("bart")}
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' show_engines("bart")
#'
#' bart(mode = "regression", trees = 5)
Expand Down
2 changes: 1 addition & 1 deletion R/boost_tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#' @seealso \Sexpr[stage=render,results=rd]{parsnip:::make_seealso_list("boost_tree")},
#' [xgb_train()], [C5.0_train()]
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' show_engines("boost_tree")
#'
#' boost_tree(mode = "classification", trees = 20)
Expand Down
4 changes: 2 additions & 2 deletions R/c5_rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#' @seealso [C50::C5.0()], [C50::C5.0Control()],
#' \Sexpr[stage=render,results=rd]{parsnip:::make_seealso_list("C5_rules")}
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' show_engines("C5_rules")
#'
#' C5_rules()
Expand Down Expand Up @@ -73,7 +73,7 @@ C5_rules <-
#'
#' @param object A `C5_rules` model specification.
#' @inheritParams update.boost_tree
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#'
#' # ------------------------------------------------------------------------------
#'
Expand Down
2 changes: 1 addition & 1 deletion R/condense_control.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @keywords internal
#' @export
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' ctrl <- control_parsnip(catch = TRUE)
#' ctrl$allow_par <- TRUE
#' str(ctrl)
Expand Down
2 changes: 1 addition & 1 deletion R/control_parsnip.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' @return An S3 object with class "control_parsnip" that is a named list
#' with the results of the function call
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' control_parsnip(verbosity = 2L)
#'
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/cubist_rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ cubist_rules <-
# ------------------------------------------------------------------------------

#' @param object A Cubist model specification.
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#'
#' # ------------------------------------------------------------------------------
#'
Expand Down
2 changes: 1 addition & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' @docType data
#' @return \item{model_db}{a data frame}
#' @keywords datasets internal
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' data(model_db)
NULL

2 changes: 1 addition & 1 deletion R/decision_tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#'
#' @seealso \Sexpr[stage=render,results=rd]{parsnip:::make_seealso_list("decision_tree")}
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' show_engines("decision_tree")
#'
#' decision_tree(mode = "classification", tree_depth = 5)
Expand Down
3 changes: 1 addition & 2 deletions R/engine_docs.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#' Knit engine-specific documentation
#' @param pattern A regular expression to specify which files to knit. The
#' default knits all engine documentation files.
#' @param ... Options passed to [knitr::knit()].
#' @return A tibble with column `file` for the file name and `result` (a
#' character vector that echos the output file name or, when there is
#' a failure, the error message).
Expand Down Expand Up @@ -138,7 +137,7 @@ update_model_info_file <- function(path = "inst/models.tsv") {
#' @name doc-tools
#' @keywords internal
#' @export
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' # See this file for step-by-step instructions.
#' system.file("README-DOCS.md", package = "parsnip")
#'
Expand Down
4 changes: 2 additions & 2 deletions R/engines.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ load_libs <- function(x, quiet, attach = FALSE) {
#' @param ... Any optional arguments associated with the chosen computational
#' engine. These are captured as quosures and can be tuned with `tune()`.
#' @return An updated model specification.
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' # First, set main arguments using the standardized names
#' logistic_reg(penalty = 0.01, mixture = 1/3) %>%
#' # Now specify how you want to fit the model with another argument
Expand Down Expand Up @@ -160,7 +160,7 @@ set_engine.default <- function(object, engine, ...) {
#' @param x The name of a `parsnip` model (e.g., "linear_reg", "mars", etc.)
#' @return A tibble.
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' show_engines("linear_reg")
#' @export
show_engines <- function(x) {
Expand Down
2 changes: 1 addition & 1 deletion R/extract.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#' section.
#'
#' @name extract-parsnip
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' lm_spec <- linear_reg() %>% set_engine("lm")
#' lm_fit <- fit(lm_spec, mpg ~ ., data = mtcars)
#'
Expand Down
2 changes: 1 addition & 1 deletion R/fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#' a "reverse Kaplan-Meier" curve that models the probability of censoring. This
#' may be used later to compute inverse probability censoring weights for
#' performance measures.
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' # Although `glm()` only has a formula interface, different
#' # methods for specifying the model can be used
#'
Expand Down
2 changes: 1 addition & 1 deletion R/fit_control.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' @return An S3 object with class "control_parsnip" that is a named list
#' with the results of the function call
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' fit_control(verbosity = 2L)
#'
#' @details
Expand Down
2 changes: 1 addition & 1 deletion R/gen_additive_mod.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#'
#' @seealso \Sexpr[stage=render,results=rd]{parsnip:::make_seealso_list("gen_additive_mod")}
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' show_engines("gen_additive_mod")
#'
#' gen_additive_mod()
Expand Down
2 changes: 1 addition & 1 deletion R/grouped_binomial.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#' @param ... Options to pass to [stats::glm()]. If `family` is not set, it will
#' automatically be assigned the basic binomial family.
#' @return A object produced by [stats::glm()].
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' #----------------------------------------------------------------------------
#' # The same data set formatted three ways
#'
Expand Down
2 changes: 1 addition & 1 deletion R/linear_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#'
#' @seealso \Sexpr[stage=render,results=rd]{parsnip:::make_seealso_list("linear_reg")}
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' show_engines("linear_reg")
#'
#' linear_reg()
Expand Down
2 changes: 1 addition & 1 deletion R/logistic_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#'
#' @seealso \Sexpr[stage=render,results=rd]{parsnip:::make_seealso_list("logistic_reg")}
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' show_engines("logistic_reg")
#'
#' logistic_reg()
Expand Down
2 changes: 1 addition & 1 deletion R/mars.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#'
#' @seealso \Sexpr[stage=render,results=rd]{parsnip:::make_seealso_list("mars")}
#'
#' @examples
#' @examplesIf !parsnip:::is_cran_check()
#' show_engines("mars")
#'
#' mars(mode = "regression", num_terms = 5)
Expand Down
Loading

0 comments on commit fc953dd

Please sign in to comment.