soda-inria / hazardous

Competing Risks and Survival Analysis
https://soda-inria.github.io/hazardous/
MIT License
46 stars 11 forks source link

Add Brier Score metrics #10

Closed Vincent-Maladiere closed 1 year ago

Vincent-Maladiere commented 1 year ago

What does this PR implement?

This is the implementation of the Brier score metrics module:

This also implements the IPCWEstimator used by the BrierScoreComputer. We have a dependency on lifelines but not on scikit-survival.

Remarks

- This fixes a subtle bug in y_binary, making our previous implementation of brier_score() incorrect. It now matches scikit-survival results. ~~Edit: y_true_binary is 1 when we observed an event, and 0 otherwise, which is correct for our Gradient Boosting classification or regression target. However, when computing the Brier Score metric, we actually need np.logical_not(y_true_binary). Indeed, when we observed an event, the survival probability drops to 0. Otherwise, it stays at 1. The Brier Score uses the survival probability, not the incidence probability.~~

ogrisel commented 1 year ago

Let's add some tests to check some mathematical properties:

ogrisel commented 1 year ago

Ok @Vincent-Maladiere I think this is ready for final pass of review on your end.

ogrisel commented 1 year ago

I rendered the HTML of the doc locally but I realize that we do not have a CI job to do it for the PR. Only for publishing the result in the merge of the PR.

I think the easiest way to achieve this would be to configure a circle CI job for this project. Let's do that later in a separate PR.