Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoroller committed Jan 7, 2025
1 parent bb594ce commit 21fa787
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/notebooks/loss_time_covariates.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def neg_partial_time_log_likelihood(
tensor(37.8082, grad_fn=<SumBackward0>)
>>> from torchsurv.metrics.cindex import ConcordanceIndex
>>> cindex = ConcordanceIndex()
>>> cindex_t = torch.stack([cindex(log_hz_t, event, time) for log_hz_t in estimates.unbind(0)]) # Compute for each time step t
>>> cindex_t
>>> cindex_t = torch.stack([cindex(log_hz_t, event, time) for log_hz_t in estimates.unbind(0)])
>>> cindex_t # Compute c-index for each time step t
tensor([0.6061, 0.2424, 0.5758, 0.3333, 0.5152])
>>> cindex_t.mean() # Average over all time steps t
tensor(0.4545)
Expand Down

0 comments on commit 21fa787

Please sign in to comment.