@@ -231,33 +231,3 @@ prepare_data <- function(object, new_data) {
231231 new_data
232232}
233233
234- # Define a generic to make multiple predictions for the same model object ------
235-
236- # ' Model predictions across many sub-models
237- # '
238- # ' For some models, predictions can be made on sub-models in the model object.
239- # ' @param object A `model_fit` object.
240- # ' @param ... Optional arguments to pass to `predict.model_fit(type = "raw")`
241- # ' such as `type`.
242- # ' @return A tibble with the same number of rows as the data being predicted.
243- # ' Mostly likely, there is a list-column named `.pred` that is a tibble with
244- # ' multiple rows per sub-model.
245- # ' @export
246- multi_predict <- function (object , ... ) {
247- if (inherits(object $ fit , " try-error" )) {
248- warning(" Model fit failed; cannot make predictions." , call. = FALSE )
249- return (NULL )
250- }
251- UseMethod(" multi_predict" )
252- }
253-
254- # ' @export
255- # ' @rdname multi_predict
256- multi_predict.default <- function (object , ... )
257- stop(" No `multi_predict` method exists for objects with classes " ,
258- paste0(" '" , class(), " '" , collapse = " , " ), call. = FALSE )
259-
260- # ' @export
261- predict.model_spec <- function (object , ... ) {
262- stop(" You must use `fit()` on your model specification before you can use `predict()`." , call. = FALSE )
263- }
0 commit comments