2

I am using the tidymodels R package to fit a random forest model with the ranger engine, but I think this question is general to tuning any type of model tidymodels supports.

When running my tuning grid, I would like to record the time it takes to fit each model and treat this run time like any another metric. The reason I want to do this is to look for areas in the parameter space where the significant gains in AUC can be had for minor increases in run time, versus areas where there is a diminishing returns on run time.

After Googling and looking through the package docs I did not find any built-in metrics.

Does anybody know of the 'official' way to collect run time information from tune_grid()? Or know a third-party package that adds run time metrics?

I can do it the old-fashioned way, by running my fits in a loop and recording system.time() at each step, but this seems like a practical need other people would have had long before me, so I'm hoping to find an existing solution that uses tidymodels workflows.

bokov
  • 3,444
  • 2
  • 31
  • 49

0 Answers0