fit_resample() can be used to check how much the performance changes when the data changes, so it is used to determine the performance when the data is not overfit.
fit_resample(wfl, vfold)%>%
collect_metrics()
If I want to use it for predict(), I need to extract it from fit_resample() by extract_workflow(), then last_fit() and then extract_workflow().
With the above operations, a trained model has been obtained.
I could only get an empty workflow out of fit_resample().
Is it possible to retrieve a model that has already been trained in train from fit_resample(), as in last_fit()?
P.S.
I was reading the "stacks" package github code, and it seems that the trained model was created using [["train"]] from the fit_member() object, so I'm thinking that if the same operation is happening in fit_resample(), it could be retrieved.
No. It only builds models from the resampled versions of the data.
For example, if you are using 10-fold cross-validation, 10 different models are created from 10 different versions of the training set. This function does not fit the 11th model to the entire training set. fit() does that.
I think the confusion is related to stacking. It might help to look a this presentation especially the parts around slide number 7.
This function does not fit the 11th model to the entire training set. fit() does that.
Thank you very much.
I would have been happy if the results of fit(data=train) could be extracted from fit_resample() using extra_workflow(), but your answer shows that this is not possible.