Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@larskotthoff
Copy link
Member

Plot labelling for >9 experiments is currently broken because in the character representation of the experiment numbers, 9 comes after 10, 11, etc, which leads to a reordering of the boxes without a corresponding reordering of the labels. Example:

library(mlr3)
library(mlr3learners)
library(mlr3viz)

design = benchmark_grid(
    tasks = list(tsk("sonar"), tsk("iris"), tsk("german_credit")),
    learners = list(lrn("classif.featureless"), lrn("classif.log_reg"), lrn("classif.ranger"), lrn("classif.rpart")),
    resamplings = rsmp("cv", folds = 3)
)
bmr = benchmark(design)

print(bmr$aggregate())
autoplot(bmr)

In the first panel the featureless learner moves to the end and is mislabelled.

This PR fixes the issue by zero-padding the strings generated from the numbers. Note that this is technically a workaround and will break if someone ever tries to show the results of more than 999,999,999 experiments in one plot.

@mllg mllg merged commit 301174f into main Mar 4, 2021
@mllg mllg deleted the benchmark-labelling branch March 4, 2021 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants