Skip to content

Commit 3f924d8

Browse files
committed
merge main
Merge commit '00f3cdb5500b55043866d22bd45f47bd01bc5ecf' #Conflicts: # NEWS.md # tests/testthat/_snaps/misc.md # tests/testthat/test_misc.R
2 parents f2fc292 + 00f3cdb commit 3f924d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+451
-102
lines changed

NAMESPACE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ S3method(print,control_parsnip)
6161
S3method(print,model_fit)
6262
S3method(print,model_spec)
6363
S3method(print,nullmodel)
64-
S3method(req_pkgs,model_fit)
65-
S3method(req_pkgs,model_spec)
6664
S3method(required_pkgs,model_fit)
6765
S3method(required_pkgs,model_spec)
6866
S3method(set_args,default)

NEWS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,24 @@
22

33
* glmnet models fitted with base-R family objects are now supported for `linear_reg()`, `logistic_reg()`, and `multinomial_reg()` (#890).
44

5+
* Moved forward with the deprecation of `req_pkgs()` in favor of `required_pkgs()`. The function will now error (#871).
6+
57
* Made `fit()` behave consistently with respect to missingness in the classification setting. Previously, `fit()` erroneously raised an error about the class of the outcome when there were no complete cases, and now always passes along complete cases to be handled by the modeling function (#888).
68

9+
* Fixed bug where model fits with factor predictors and `engine = "kknn"` would fail when the package's namespace hadn't been attached (#264).
10+
711
* `.organize_glmnet_pred()` now expects predictions for a single penalty value (#876).
812

13+
* Fixed bug where model fits with `engine = "earth"` would fail when the package's namespace hadn't been attached (#251).
14+
915
* Fixed bug with prediction from a boosted tree model fitted with `"xgboost"` using a custom objective function (#875).
1016

1117
* Several internal functions (to help work with `Surv` objects) were added as a standalone file that can be used in other packages via `usethis::use_standalone("tidymodels/parsnip")`.
1218

19+
* Rather than being implemented in each method, the check for the `new_data` argument being mistakenly passed as `newdata` to `multi_predict()` now happens in the generic. Packages re-exporting the `multi_predict()` generic and implementing now-duplicate checks may see new failures and can remove their own analogous checks. This check already existed in all `predict()` methods (via `predict.model_fit()`) and all parsnip `multi_predict()` methods (#525).
20+
21+
* `logistic_reg()` will now warn at `fit()` when the outcome has more than two levels (#545).
22+
1323
* Functions now indicate what class the outcome was if the outcome is the wrong class (#887).
1424

1525
# parsnip 1.0.4

R/aaa_multi_predict.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ multi_predict <- function(object, ...) {
2222
rlang::warn("Model fit failed; cannot make predictions.")
2323
return(NULL)
2424
}
25+
check_for_newdata(...)
2526
UseMethod("multi_predict")
2627
}
2728

R/auto_ml.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#' @param engine A single character string specifying what computational engine
1818
#' to use for fitting.
1919
#'
20+
#' @templateVar modeltype auto_ml
2021
#' @template spec-details
2122
#'
2223
#' @template spec-references

R/bag_mars.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#'
1515
#' @inheritParams mars
1616
#'
17+
#' @templateVar modeltype bag_mars
1718
#' @template spec-details
1819
#'
1920
#' @template spec-references

R/bag_mlp.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#'
1313
#' @inheritParams mlp
1414
#'
15+
#' @templateVar modeltype bag_mlp
1516
#' @template spec-details
1617
#'
1718
#' @template spec-references

R/bag_tree.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#' factor is the minority class. If this is not the case, values between zero
1717
#' and one can be used to bias to the second level of the factor.
1818
#'
19+
#' @templateVar modeltype bag_tree
1920
#' @template spec-details
2021
#'
2122
#' @template spec-references

R/bart.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#' terminal node for different values of these parameters.
3636
#'
3737
#'
38+
#' @templateVar modeltype bart
3839
#' @template spec-details
3940
#'
4041
#' @template spec-references

R/boost_tree.R

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#' @param stop_iter The number of iterations without improvement before
4040
#' stopping (specific engines only).
4141
#'
42+
#' @templateVar modeltype boost_tree
4243
#' @template spec-details
4344
#'
4445
#' @template spec-references
@@ -479,10 +480,6 @@ get_event_level <- function(model_spec){
479480
#' @param trees An integer vector for the number of trees in the ensemble.
480481
multi_predict._xgb.Booster <-
481482
function(object, new_data, type = NULL, trees = NULL, ...) {
482-
if (any(names(enquos(...)) == "newdata")) {
483-
rlang::abort("Did you mean to use `new_data` instead of `newdata`?")
484-
}
485-
486483
if (is.null(trees)) {
487484
trees <- object$fit$nIter
488485
}
@@ -607,9 +604,6 @@ C5.0_train <-
607604
#' @rdname multi_predict
608605
multi_predict._C5.0 <-
609606
function(object, new_data, type = NULL, trees = NULL, ...) {
610-
if (any(names(enquos(...)) == "newdata"))
611-
rlang::abort("Did you mean to use `new_data` instead of `newdata`?")
612-
613607
if (is.null(trees))
614608
trees <- min(object$fit$trials)
615609
trees <- sort(trees)

R/c5_rules.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#'
3131
#' @references Quinlan R (1993). _C4.5: Programs for Machine Learning_. Morgan
3232
#' Kaufmann Publishers.
33+
#'
34+
#' @templateVar modeltype C5_rules
3335
#' @template spec-details
3436
#'
3537
#' @template spec-references

0 commit comments

Comments
 (0)