Skip to content

Commit

Permalink
the check is already carried out via predict()
Browse files Browse the repository at this point in the history
  • Loading branch information
hfrick committed Jul 27, 2024
1 parent 5f0e9dd commit cda9b61
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions R/poisson_reg-glmnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
#' @export
predict._fishnet <-
function(object, new_data, type = NULL, opts = list(), penalty = NULL, multi = FALSE, ...) {
if (any(names(enquos(...)) == "newdata")) {
rlang::abort("Did you mean to use `new_data` instead of `newdata`?")
}

# See discussion in https://github.com/tidymodels/parsnip/issues/195
if (is.null(penalty) & !is.null(object$spec$args$penalty)) {
penalty <- object$spec$args$penalty
Expand All @@ -43,10 +39,6 @@ predict._fishnet <-

#' @export
predict_numeric._fishnet <- function(object, new_data, ...) {
if (any(names(enquos(...)) == "newdata")) {
rlang::abort("Did you mean to use `new_data` instead of `newdata`?")
}

object$spec <- parsnip::eval_args(object$spec)
parsnip::predict_numeric.model_fit(object, new_data = new_data, ...)
}
Expand All @@ -65,10 +57,6 @@ predict_numeric._fishnet <- function(object, new_data, ...) {
#' @export
#' @keywords internal
predict_raw._fishnet <- function(object, new_data, opts = list(), ...) {
if (any(names(enquos(...)) == "newdata")) {
rlang::abort("Did you mean to use `new_data` instead of `newdata`?")
}

object$spec <- parsnip::eval_args(object$spec)
opts$s <- object$spec$args$penalty
parsnip::predict_raw.model_fit(object, new_data = new_data, opts = opts, ...)
Expand Down

0 comments on commit cda9b61

Please sign in to comment.