Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot ROC & PRC curves #321

Merged
merged 44 commits into from Jan 13, 2023
Merged

Plot ROC & PRC curves #321

merged 44 commits into from Jan 13, 2023

Conversation

kelly-sovacool
Copy link
Member

@kelly-sovacool kelly-sovacool commented Jan 7, 2023

This code heavily borrows from @courtneyarmour's code club on ROC curves, so I made her a co-author on the initial commit 8982fb7.

Issues

Change(s) made

  • New exported functions:
    • calc_model_sensspec() - calculate sensitivity, specificity, precision for a model
    • calc_mean_roc() & plot_mean_roc() - calculate & plot specificity and mean sensitivity for multiple models
    • calc_mean_prc() & plot_mean_prc() - calculate & plot recall and mean precision for multiple models
  • New internal functions to help reduce code duplication:
    • calc_mean_perf() - used by calc_mean_roc() and calc_mean_prc()
    • shared_ggprotos() - used by plot_mean_roc() and plot_mean_prc()
  • Updated vignette('parallel') to show how to plot ROC and PRC curves.

Checklist

(Strikethrough any points that are not applicable.)

  • Write unit tests for any new functionality or bug fixes.
  • Update docs if there are any API changes:
    • roxygen comments
    • vignettes
  • Update NEWS.md if this includes any user-facing changes.
  • The check workflow succeeds on your most recent commit. This is always required before the PR can be merged.

@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2023

Codecov Report

Base: 98.01% // Head: 98.18% // Increases project coverage by +0.17% 🎉

Coverage data is based on head (f843886) compared to base (5b2cc3a).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
+ Coverage   98.01%   98.18%   +0.17%     
==========================================
  Files          13       13              
  Lines        1007     1103      +96     
==========================================
+ Hits          987     1083      +96     
  Misses         20       20              
Impacted Files Coverage Δ
R/preprocess.R 100.00% <ø> (ø)
R/train.R 100.00% <ø> (ø)
R/utils.R 100.00% <ø> (ø)
R/performance.R 100.00% <100.00%> (ø)
R/plot.R 79.16% <100.00%> (+10.41%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Tried to include results list & mtx as package data,
but it's too big for CRAN.
Using them as test fixtures works when using
system.file() to access them in the vignette.
@kelly-sovacool kelly-sovacool marked this pull request as ready for review January 9, 2023 16:15
@courtneyarmour courtneyarmour merged commit f5c6119 into main Jan 13, 2023
@courtneyarmour courtneyarmour deleted the iss-262_roc branch January 13, 2023 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ROC curve example code to docs
3 participants