tidymodels / tune

Tools for tidy parameter tuning
https://tune.tidymodels.org
Other
271 stars 42 forks source link

Add alt text to `autoplot` methods #380

Closed juliasilge closed 10 months ago

juliasilge commented 3 years ago

To improve accessibility, we can add alt labels to the output of the autoplot methods.

library(tidymodels)
#> Registered S3 method overwritten by 'tune':
#>   method                   from   
#>   required_pkgs.model_spec parsnip

set.seed(6735)
folds <- vfold_cv(mtcars, v = 5)

spline_rec <-
  recipe(mpg ~ ., data = mtcars) %>%
  step_ns(disp, deg_free = tune("disp")) %>%
  step_ns(wt, deg_free = tune("wt"))

lin_mod <-
  linear_reg() %>%
  set_engine("lm")

spline_grid <- crossing(disp = 2:5, wt = 2:5)

spline_res <-
  tune_grid(lin_mod, spline_rec, resamples = folds, grid = spline_grid)

autoplot(spline_res) +
  labs(
    alt = paste0("Tuning results with small multiples showing two metrics:", 
                 "RMSE and R squared. The x-axis displays disp, ",
                 "the y-axis displays mean metric value over the resamples, ",
                 "and color displays wt.")
  )

Created on 2021-05-19 by the reprex package (v2.0.0)

This is just one initial idea of what to include and how to include it; we can do more learning about how to write alt text for this context.

simonpcouch commented 10 months ago

Glad that you filed this issue—thank you. In light of our learnings in the last couple years, lets move forward with writing alt text image-by-image in favor of automated alt text. Closing in favor of #748.

github-actions[bot] commented 9 months ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.