This function updates and returns the model leaderboard for the project. Please read the README and the introduction vignette.

board(model = NULL, path = NULL, dir = NULL, save = TRUE,
  quiet = FALSE)

Arguments

model

model to add to the leaderboard. If no model is supplied (the default null), board returns the leaderboard tibble for the project.

path

globally sets the path to save models and leaderboards. By default, the path is the project directory found by. For best results, the path string should be constructed with file.path or here::here().

dir

globally sets name of directory where models are saved. This will be a subdirectory of the specified path. The default directory is named models_one. If no argument is supplied, the model will be saved in the previously specified directory. See the example below.

save

whether board should save the supplied model to dir. If FALSE the model will not be saved, but will be added to the leaderboard.

quiet

whether board should return the leaderboard tibble to the console. By default quiet = FALSE means that the tibble prints to console. quiet = TRUE is useful in a .Rmd environment, where you want to add the model to the leaderboard without printing the tibble.

Value

tibble containing the most up-to-date leaderboard.

Examples

# add caret model to leaderboard # model saved to "models_one" model <- train(...)
#> Error in train(...): could not find function "train"
leadr::board(model)
#> # A tibble: 26 x 13 #> rank id dir model metric score public method num group index tune #> <dbl> <id> <chr> <chr> <chr> <dbl> <dbl> <chr> <dbl> <dbl> <lis> <lis> #> 1 1. 26 model… glmnet Accur… 0.973 NA cv 5. 25. <lis… <lis… #> 2 2. 5 model… glmnet Accur… 0.964 NA boot 25. 1. <lis… <lis… #> 3 3. 14 model… rf Accur… 0.959 NA boot 25. 13. <lis… <lis… #> 4 4. 20 model… rf Accur… 0.959 NA boot 25. 19. <lis… <lis… #> 5 5. 22 model… rf Accur… 0.958 NA boot 25. 21. <lis… <lis… #> 6 6. 11 model… rf Accur… 0.958 NA boot 25. 10. <lis… <lis… #> 7 7. 8 model… rf Accur… 0.957 NA boot 25. 7. <lis… <lis… #> 8 8. 7 model… rf Accur… 0.957 NA boot 25. 6. <lis… <lis… #> 9 9. 18 model… rf Accur… 0.955 NA boot 25. 17. <lis… <lis… #> 10 10. 10 model… rf Accur… 0.955 NA boot 25. 9. <lis… <lis… #> # ... with 16 more rows, and 1 more variable: seeds <list>
# return tibble leaderboard leadr::board()
#> # A tibble: 26 x 13 #> rank id dir model metric score public method num group index tune #> <dbl> <id> <chr> <chr> <chr> <dbl> <dbl> <chr> <dbl> <dbl> <lis> <lis> #> 1 1. 26 model… glmnet Accur… 0.973 NA cv 5. 25. <lis… <lis… #> 2 2. 5 model… glmnet Accur… 0.964 NA boot 25. 1. <lis… <lis… #> 3 3. 14 model… rf Accur… 0.959 NA boot 25. 13. <lis… <lis… #> 4 4. 20 model… rf Accur… 0.959 NA boot 25. 19. <lis… <lis… #> 5 5. 22 model… rf Accur… 0.958 NA boot 25. 21. <lis… <lis… #> 6 6. 11 model… rf Accur… 0.958 NA boot 25. 10. <lis… <lis… #> 7 7. 8 model… rf Accur… 0.957 NA boot 25. 7. <lis… <lis… #> 8 8. 7 model… rf Accur… 0.957 NA boot 25. 6. <lis… <lis… #> 9 9. 18 model… rf Accur… 0.955 NA boot 25. 17. <lis… <lis… #> 10 10. 10 model… rf Accur… 0.955 NA boot 25. 9. <lis… <lis… #> # ... with 16 more rows, and 1 more variable: seeds <list>
# save to different directory ensemble <- train(...)
#> Error in train(...): could not find function "train"
leadr::board(ensemble, dir = "ensembles_one")
#> Error in leadr::board(ensemble, dir = "ensembles_one"): object 'ensemble' not found
# board automatically saves to previous directory # model saved to "ensembles_one" ensemble2 <- train(...)
#> Error in train(...): could not find function "train"
leadr::board(ensembles2)
#> Error in leadr::board(ensembles2): object 'ensembles2' not found