autoprognosis.utils.risk_estimation module

generate_dataset_for_horizon(X: DataFrame, T: DataFrame, Y: DataFrame, horizon_days: int) Tuple[DataFrame, DataFrame, DataFrame]

Generate the dataset at a certain time horizon. Useful for classifiers.

Parameters:
  • X – pd.DataFrame, the feature set

  • T – pd.DataFrame, days to event or censoring

  • Y – pd.DataFrame, outcome or censoring

  • horizon_days – int, days to the expected horizon

Returns:

the feature set for that horizon T: days to event or censoring Y: Outcome or censoring

Return type:

X

survival_probability_calibration(name: str, y_pred: DataFrame, T_test: DataFrame, y_test: DataFrame, t0: float, ax: Any, color: str) Tuple

Smoothed calibration curves for time-to-event models. This is analogous to calibration curves for classification models, extended to handle survival probabilities and censoring. Produces a matplotlib figure and some metrics.

We want to calibrate our model’s prediction of \(P(T < ext{t0})\) against the observed frequencies.