mlr3book
                                
                                
                                
                                    mlr3book copied to clipboard
                            
                            
                            
                        Auto-generate tables for dictionaries
Example would be table of resamplings in the performance chapter, which is currently manually created.
This is both tedious and prone to error, see e.g. the omission of custom_cv (#399).
For cases like this I'd like to auto-generate tables from dictionaries with auto-linked help pages, and I came up with something along those lines (which could of course be improved/generalized, but the idea is straight forward):
library(mlr3)
resampling_dt <- as.data.table(mlr_resamplings)[, c("label", "key")]
resampling_dt$key <- vapply(resampling_dt$key, function(x) {
  mlr3book::ref(topic = paste0("mlr_resamplings_", x), text = sprintf("\"%s\"", x))
}, character(1))
knitr::kable(
  resampling_dt, escape = FALSE,
  col.names = c("Name", "Identifier"),
  caption = "Resampling strategies included in mlr3"
)
| Name | Identifier | 
|---|---|
| Bootstrap | "bootstrap" | 
| Custom Splits | "custom" | 
| Custom Split Cross-Validation | "custom_cv" | 
| Cross-Validation | "cv" | 
| Holdout | "holdout" | 
| Insample Resampling | "insample" | 
| Leave-One-Out | "loo" | 
| Repeated Cross-Validation | "repeated_cv" | 
| Subsampling | "subsampling" | 
Resampling strategies included in mlr3
Created on 2022-09-09 with reprex v2.0.2
We already do so in the mlr3website. You could copy the logic from there.
I don't think we should necessarily do this. The tables we currently have already don't provide enough info to be valuable to the user, in your example it would be useful to add a column that very briefly explains each method.
I guess it makes sense in the HTML context where it's a clickable link to the docs, as a "further reading" - but I see how in the printed/offline-PDF context it's not necessarily valuable.
Depends on whether the "overview of things available via 
General issue unfortunately. Agreed for online we want it to always be up-to-date but of course this isn't possible for the book. My preference is to pick consistency based on the book and accept this is sub-optimal (happy to be convinced otherwise).
Could be appendices that are not included in the print version? I also agree that we want this online, but I don't think it would add much value for the book.
Or we could do something similar to the learner search but for all our dictionaries?