# ℹ Bootstrap08: 1 eliminated 5 candidates remain. ![]() # ℹ Bootstrap06: 0 eliminated 6 candidates remain. # ℹ Bootstrap05: 1 eliminated 6 candidates remain. # ℹ Bootstrap18: 4 eliminated 7 candidates remain. # ℹ Bootstrap23: 9 eliminated 11 candidates remain. # ℹ Resamples are analyzed in a random order. Library ( tidymodels ) library ( finetune ) library ( mlbench ) data ( Sonar ) # create resamples set.seed ( 100 ) resamp % set_engine ( "kknn" ) %>% set_mode ( "classification" ) # center and scale the data using a recipe norm_rec % step_normalize ( all_predictors ()) ctrl % tune_race_anova ( norm_rec, resamples = resamp, grid = 20, control = ctrl ) # ℹ Racing will maximize the roc_auc metric. The grid will consist of 20 tuning parameters values in conjunction with 25 bootstrap resamples. Their analysis details are described inĪs an example, we’ll tune a K nearest neighbor (KNN) model on the sonar data. finetune has functions tune_race_anova() and tune_race_win_loss() for this purpose (with syntax similar to tune_grid()). This process can considerably reduce the total number of model evaluations. If the analysis discards any parameters, they are not resampled further. Racing methods analyze the initial results to determine if any of the tuning parameters are unacceptable enough to discard. All model parameters are evaluated on a few resamples. ![]() Maron and Moore (1994), enables a sequential type of grid search. For example, if we evaluate 50 tuning parameter values on 10 resamples, 500 model fits are evaluated before any analysis of the results takes place. The problem with this approach is that it requires all of the results to be able to make a decision. The user then choses a tuning parameter value that has acceptable results. A pre-defined set of parameters are created and often resampled so that good estimates of model performance are available. Grid search is a common method to find good values for model tuning parameters. The number of neighbors in a K nearest neighbor model is a good example. ![]() Tuning parameters are unknown quantities of a model that cannot be directly estimated from the data. This blog post will describe the two new tools in the package.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |