Skip to content

Commit

Permalink
RC 1.2.0 (#1070)
Browse files Browse the repository at this point in the history
* version bumps

* missing exports

* stop unicode characters from creeping in

* stop unicode characters from creeping in

* remove surv_reg details files

* fix broken link

---------

Co-authored-by: ‘topepo’ <‘mxkuhn@gmail.com’>
topepo and ‘topepo’ authored Feb 16, 2024
1 parent 6d4100f commit a30a15e
Showing 27 changed files with 97 additions and 474 deletions.
6 changes: 3 additions & 3 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.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
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -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)
25 changes: 15 additions & 10 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 4 additions & 0 deletions R/engine_docs.R
Original file line number Diff line number Diff line change
@@ -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)) {
36 changes: 22 additions & 14 deletions R/predict_interval.R
Original file line number Diff line number Diff line change
@@ -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")

9 changes: 0 additions & 9 deletions R/surv_reg_flexsurv.R

This file was deleted.

9 changes: 0 additions & 9 deletions R/surv_reg_survival.R

This file was deleted.

4 changes: 2 additions & 2 deletions man/details_gen_additive_mod_mgcv.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/details_mlp_brulee.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/details_proportional_hazards_glmnet.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 0 additions & 67 deletions man/details_surv_reg_flexsurv.Rd

This file was deleted.

91 changes: 0 additions & 91 deletions man/details_surv_reg_survival.Rd

This file was deleted.

22 changes: 11 additions & 11 deletions man/glmnet-details.Rd
4 changes: 2 additions & 2 deletions man/mlp.Rd
11 changes: 11 additions & 0 deletions man/other_predict.Rd
4 changes: 2 additions & 2 deletions man/parsnip_update.Rd
1 change: 1 addition & 0 deletions man/rmd/aaa.Rmd
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
options(useFancyQuotes = FALSE)
options(dplyr.print_min = 6, dplyr.print_max = 6)
options(cli.width = 85)
options(cli.unicode = FALSE)
options(crayon.enabled = FALSE)
options(pillar.min_title_chars = Inf)
2 changes: 1 addition & 1 deletion man/rmd/gen_additive_mod_mgcv.Rmd
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ gen_additive_mod() %>%
The smoothness of the terms will need to be manually specified (e.g., using `s(x, df = 10)`) in the formula. Tuning can be accomplished using the `adjust_deg_free` parameter.


When using a workflow, pass the _model formula_ to [add_model()]'s `formula` argument, and a simplified _preprocessing formula_ elsewhere.
When using a workflow, pass the _model formula_ to [workflows::add_model()]'s `formula` argument, and a simplified _preprocessing formula_ elsewhere.

```{r}
spec <-
2 changes: 1 addition & 1 deletion man/rmd/gen_additive_mod_mgcv.md
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ gen_additive_mod() %>%
The smoothness of the terms will need to be manually specified (e.g., using `s(x, df = 10)`) in the formula. Tuning can be accomplished using the `adjust_deg_free` parameter.


When using a workflow, pass the _model formula_ to [add_model()]'s `formula` argument, and a simplified _preprocessing formula_ elsewhere.
When using a workflow, pass the _model formula_ to [workflows::add_model()]'s `formula` argument, and a simplified _preprocessing formula_ elsewhere.


```r
22 changes: 11 additions & 11 deletions man/rmd/glmnet-details.md
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ predict(fit, mtcars[1:3,])
```

```
## # A tibble: 3 × 1
## # A tibble: 3 x 1
## .pred
## <dbl>
## 1 22.2
@@ -51,12 +51,12 @@ multi_predict(fit, mtcars[1:3,], penalty = c(0.00, 0.01))
```

```
## # A tibble: 3 × 1
## # A tibble: 3 x 1
## .pred
## <list>
## 1 <tibble [2 × 2]>
## 2 <tibble [2 × 2]>
## 3 <tibble [2 × 2]>
## 1 <tibble [2 x 2]>
## 2 <tibble [2 x 2]>
## 3 <tibble [2 x 2]>
```

```r
@@ -67,7 +67,7 @@ multi_predict(fit, mtcars[1:3,], penalty = c(0.00, 0.01)) %>%
```

```
## # A tibble: 6 × 3
## # A tibble: 6 x 3
## penalty .pred .row
## <dbl> <dbl> <int>
## 1 0 22.6 1
@@ -138,7 +138,7 @@ predict(fit_ridge, mtcars[1:3,])
```

```
## # A tibble: 3 × 1
## # A tibble: 3 x 1
## .pred
## <dbl>
## 1 22.1
@@ -160,7 +160,7 @@ tidy(fit)
```

```
## # A tibble: 11 × 3
## # A tibble: 11 x 3
## term estimate penalty
## <chr> <dbl> <dbl>
## 1 (Intercept) 35.3 1
@@ -169,7 +169,7 @@ tidy(fit)
## 4 hp -0.0101 1
## 5 drat 0 1
## 6 wt -2.59 1
## # 5 more rows
## # i 5 more rows
```

Note that there is a `tidy()` method for `glmnet` objects in the `broom` package. If this is used directly on the underlying `glmnet` object, it returns _all of coefficients on the path_:
@@ -182,7 +182,7 @@ all_tidy_coefs
```

```
## # A tibble: 640 × 5
## # A tibble: 640 x 5
## term step estimate lambda dev.ratio
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 (Intercept) 1 20.1 5.15 0
@@ -191,7 +191,7 @@ all_tidy_coefs
## 4 (Intercept) 4 24.7 3.89 0.347
## 5 (Intercept) 5 26.0 3.55 0.429
## 6 (Intercept) 6 27.2 3.23 0.497
## # 634 more rows
## # i 634 more rows
```

```r
4 changes: 1 addition & 3 deletions man/rmd/mlp_brulee.md
Original file line number Diff line number Diff line change
@@ -7,14 +7,12 @@ For this engine, there are multiple modes: classification and regression



This model has 7 tuning parameters:
This model has 6 tuning parameters:

- `hidden_units`: # Hidden Units (type: integer, default: 3L)

- `penalty`: Amount of Regularization (type: double, default: 0.0)

- `mixture`: Proportion of Lasso Penalty (type: double, default: 0.0)

- `epochs`: # Epochs (type: integer, default: 100L)

- `dropout`: Dropout Rate (type: double, default: 0.0)
2 changes: 1 addition & 1 deletion man/rmd/proportional_hazards_glmnet.md
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ predict(mod, pred_data, type = "survival", time = 500) %>%
```

```
## # A tibble: 2 × 5
## # A tibble: 2 x 5
## .eval_time .pred_survival age ecog.ps rx
## <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 500 0.666 50 1 1
50 changes: 0 additions & 50 deletions man/rmd/surv_reg_flexsurv.Rmd

This file was deleted.

52 changes: 0 additions & 52 deletions man/rmd/surv_reg_flexsurv.md

This file was deleted.

55 changes: 0 additions & 55 deletions man/rmd/surv_reg_survival.Rmd

This file was deleted.

76 changes: 0 additions & 76 deletions man/rmd/surv_reg_survival.md

This file was deleted.

4 changes: 3 additions & 1 deletion man/rpart_train.Rd

0 comments on commit a30a15e

Please sign in to comment.