Add documentation and make rounding for correlation() explicit#320
Merged
nikosbosse merged 5 commits intoscoringutils-reviewfrom Oct 14, 2023
Merged
Add documentation and make rounding for correlation() explicit#320nikosbosse merged 5 commits intoscoringutils-reviewfrom
correlation() explicit#320nikosbosse merged 5 commits intoscoringutils-reviewfrom
Conversation
… digits the output is rounded to
Codecov Report
@@ Coverage Diff @@
## scoringutils-review #320 +/- ##
======================================================
Coverage ? 90.88%
======================================================
Files ? 22
Lines ? 1394
Branches ? 0
======================================================
Hits ? 1267
Misses ? 127
Partials ? 0 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
seabbs
approved these changes
Oct 3, 2023
Contributor
seabbs
left a comment
There was a problem hiding this comment.
Looks good. I agree that rounding should likely live in the plotting function if its the default
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses comments made by review from the Journal of Statistical Software.
It
summarise_scores().correlation(). Previously, the function always rounded correlations to two digits. Instead, this PR introduces a new argument,digits(with the default set to 0, meaning that no rounding takes place).This is one possible proposal to handle the rounding and there may be other ways to do this. Here are some thoughts:
digits = NULLor something like that also feels slightly weird.digitsargument doesn't have to live incorrelation(). It could also e.g. live inplot_correlation(). I introduced it here for the following reasons:correlation()is a data.table with numeric and non-numeric columns (the metric names). Rounding them using only data.table code is clunky (I guess you can do something likedt[, lapply(.SD, round, 2), .SDcols = sapply(dt, is.numeric)], but then you still have to manually add back the metric names column).plot_correlations()at some point, then it seems cleaner to me to have the rounding incorrelation()rather than inplot_correlations().