tidymodels / parsnip

A tidy unified interface to models
https://parsnip.tidymodels.org
Other
601 stars 89 forks source link

transition warning to error when predicting from a failed model fit #1184

Open simonpcouch opened 2 months ago

simonpcouch commented 2 months ago

There's a good bit of this throughout the source:

https://github.com/tidymodels/parsnip/blob/8af5ddf29afc17272d6768785423cf391e2685c8/R/predict_raw.R#L18-L21

A couple thoughts:

1) This warning likely ought to be an error. 2) We can set parent = object$fit so that the model fit error is surfaced as part of the message. 3) This pattern should live inside of a helper.