Skip to content

Commit

Permalink
Add survival proba along with events in SurvTRACE (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent-Maladiere authored Jan 26, 2024
1 parent bc57614 commit 76d7c81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hazardous/survtrace/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ def predict_survival_function(self, X):
return surv

def predict_cumulative_incidence(self, X):
return 1 - self.predict_survival_function(X)
risks = 1 - self.predict_survival_function(X)
surv = (1 - risks.sum(axis=0))[None, :, :]
return np.concatenate([surv, risks], axis=0)


class _SurvTRACEModule(nn.Module):
Expand Down

0 comments on commit 76d7c81

Please sign in to comment.