kdpsingh / runway

Visualizing Prediction Model Performance
Other
75 stars 11 forks source link

Feature Request: Add additional stats/functionality to `threshperf()` #12

Closed ddsjoberg closed 3 years ago

ddsjoberg commented 3 years ago

Hello hello!

I have a couple of requests for the threshperf(). I am happy to implement them, but first wanted to get your feedback before preparing a pull request.

  1. Add additional stats like the true positive rate, false positive, etc.
  2. For case control data, add the option to specify a prevalence so statistics such as true positive rate, false positive, etc. are calculable.
  3. Adapt the function (or create a new function) that can handle time to event outcomes.

Let me know what you think!

kdpsingh commented 3 years ago

Hi Dan, sorry for not getting back to you sooner.

Yes, please feel free to implement your suggested changes, particularly for 1 and 2. Although nearly all of my work is with cohort data, case-control data should be supported.

For part 3, would suggest a new function for now.

I'm planning to ultimately combine some of the smaller functions into larger ones using dispatch but I need to refactor some of the code first.

For example, cal_plot() and cal_plot_multi() will be combined into a single function cal_plot() that will dispatch to cal_plot_single() or cal_plot_multi() depending on whether a single model or multiple models are being compared.

I'd also like like to add multi-class support (with 1 vs. all) for calibration. And, I'm thinking of adopting a similar model for calibration as what I have for threshperf(), where one function handles all the computation and another does the plotting.

Runway still has a bit of a journey ahead. But I would suggest adding your changes, and I'll work them into the refactoring.

Thanks and feel free to submit a PR!