Issue #383 - Remove available_metrics()
#706
Merged
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.
Description
This PR closes #383
available_metrics()
is a remnant of the sunnier days whenscoringutils
had a restricted list of known metrics. Now that users can specify their own metrics, the function is not needed anymore and should be removed.This PR
available_metrics()
plot_correlations()
needed to be updated which relied on it.avaiable_metrics()
is now changed toget_score_names()
plot_correlations()
has to have ascore_names
attribute. The PR therefore updatescorrelation()
to output ascores
object with the necessaryscore_names
attributecorrelation()
outputs adata.table
with rownames,new_scores()
was updated to now have a...
argument which is used withincorrelation
to specifykeep.rownames = TRUE
. Withincorrelation
there is now an explicit copy statement, because without that we're getting an internal self reference error (data.table isn't happy about the rownames...). I feel like this is sufficient to address the issue here and always making a copy at the end ofnew_scores()
might be an overkillavailable_metrics()
fromget_protected_columns()
The data.table copy issue should maybe be an issue for
data.table
...Reprex:
Checklist
lintr::lint_package()
to check for style issues introduced by my changes.