This question if for tidymodels user, and if you are lazy, just skip the entire text and jump right to the bold question below
Im looking for the most efficient way to extract my parsnip model object from fitted resamples (tune::fit_resample()
).
When i want to train a model with cross-validation, i can either go with tune::tune_grid()
oder fit_resamples()
.
Lets say i know the best parameters for my algorithm, so i dont need any paramter tunig, which means i decide to go with fit_resamples()
.
If i had decided to go with tune_grid()
i usually set up a workflow since i evaluate different models after tune_grid ran: I go for tune::show_best()
and tune::select_best()
to explore and extract the best parameters for my model. Then i go for tune::finalize_workflow()
, workflows::pull_wokrflow_fit()
to extract my model object. Further when i want to see predictions i go for tune::last_fit()
and tune::collect_predictions()
All these steps seem redundant when i go with fit_resamples()
, since i basically only have one model with stable parameters. So all these steps above are not neccesarry, nevertheless i have to go trough them. Do I?
After fit_resamples()
is performed, i get a tibble with information about .splits, .metrics, .notes, etc.
So my question really comes down to:
- What is the fastest way from the output tibble of
fit_resamples()
to my final parsnip model object?