Skip to content

modeltime_calibrate() Unable to Calibrate a Linear Regression Model (R 4.3.1) - .pred_res column returned #228

@domorev

Description

@domorev

The latest version of tidyverse's predict function now returns .pred_res column instead of .pred. Because of that Modeltime is unable to calibrate the model and returns the following error:

+   modeltime_calibrate(new_data = testing(splits), quiet = FALSE)
Error:In argument: `.pred = ifelse(is.na(.pred), optins, .pred)`.
Caused by error:
! object '.pred' not found

This is the output from predict():

> lm_predictions <- workflow_fit_lm %>% 
+   predict(new_data = testing(splits))
Warning message:
In predict.lm(object = object$fit, newdata = new_data, type = "response") :
  prediction from rank-deficient fit; attr(*, "non-estim") has doubtful cases
> 
> # Typically, predictions are returned in a tibble with a `.pred` column
> lm_predictions
# A tibble: 56 × 1
   .pred_res
       <dbl>
 1      51.9
 2      63.8
 3      45.8
 4      25.4
 5      14.3
 6      14.3
 7      24.7
 8      29.2
 9      83.8
10      65.8
# ℹ 46 more rows
# ℹ Use `print(n = ...)` to see more rows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions