Skip to content

Commit

Permalink
fixing math, harmonising different notations.
Browse files Browse the repository at this point in the history
  • Loading branch information
juAlberge committed Jul 5, 2024
1 parent 012cd5e commit 176c54b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions hazardous/_ipcw.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ def compute_censoring_survival_proba(self, times, X=None, ipcw_training=False):
class AlternatingCensoringEstimator(KaplanMeierIPCW):
r"""IPCW estimator for Debiased Gradient Boosting Incidence.
Predict :math:`\hat{G}(t | X = x) = p(C > t | X = x)` using
:math:`1/\hat{S}(t | X = x) = 1/p(T^* > t | X = x)` as IPCW.
Predict :math:`\hat{G}(t | X = x) = P(C > t | X = x)` using
:math:`1/\hat{S}(t | X = x) = 1/P(T^* > t | X = x)` as IPCW.
TODO
"""
Expand Down Expand Up @@ -227,8 +227,8 @@ def compute_censoring_survival_proba(self, times, X=None, ipcw_training=False):
for each :math:`k` competing event.
The probabilities returned by the censoring estimator are
:math:`\hat{S}(t| X = x) = P(T^* > t | X = x)` and
:math:`\hat{G}(t) = P(C^* > t | X = x)`.
:math:`\hat{G}(t) = P(C > t | X = x)` and
:math:`1 - \hat{G}(t) = P(C \leq t | X = x)`.
Parameters
----------
Expand Down
10 changes: 5 additions & 5 deletions hazardous/_survival_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def draw(self, ipcw_training=False, X=None):
sampled_time_horizons[hard_zero_indices] = 0.0

if ipcw_training:
# During the training of the ICPW, we estimate G(t) = P(C > t)
# During the training of the ICPW, we estimate G(t) = P(C > t) using
# 1 / S(t) = 1 / P(T^* > t) as sample weight. t is an arbitrary
# time horizon.
# Since 1 = P(C <= t) + P(C > t), our training target is the censoring
Expand Down Expand Up @@ -180,19 +180,19 @@ class SurvivalBoost(BaseEstimator, ClassifierMixin):
.. math::
\hat{F}_k(t; x_i) \approx F_k(t; x_i) = \mathbb{P}(T \leq t, E=k | X=x_i)
\hat{F}_k(t; x_i) \approx F_k(t; x_i) = \mathbb{P}(T \leq t, \Delta=k | X=x_i)
where :math:`T` is a random variable for the uncensored time to first event
and :math:`E` is a random variable over the :math:`[1, K]` domain for the
and :math:`\Delta` is a random variable over the :math:`[1, K]` domain for the
(uncensored) event type, and :math:`x_i` is the feature vector of the
:math:`i`-th observation.
The (any event) Survival Function can be defined as:
.. math::
S(t; x_i) = \mathbb{P}(T > t) = 1 - \mathbb{P}(T \leq t | X=x_i)
= 1 - \sum_{k=1}^K \mathbb{P}(T \leq t, E=k | X=x_i)
S(t; x_i) = \mathbb{P}(T > t | X=x_i) = 1 - \mathbb{P}(T \leq t | X=x_i)
= 1 - \sum_{k=1}^K \mathbb{P}(T \leq t, \Delta=k | X=x_i)
= 1 - \sum_{k=1}^K F_k(t; x_i)
Under the hood, this class randomly samples reference time horizons
Expand Down
2 changes: 1 addition & 1 deletion hazardous/metrics/_brier_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def brier_score_incidence(
.. math::
\hat{F}_k(t | \mathbf{x}_i) \approx P(T_i \leq t, E_i = k |
\hat{F}_k(t | \mathbf{x}_i) \approx P(T_i \leq t, \Delta_i = k |
\mathbf{x}_i)
and :math:`\hat{\omega}_i(t)` are IPCW weigths based on the Kaplan-Meier
Expand Down

0 comments on commit 176c54b

Please sign in to comment.