Skip to content

v0.3.0

Choose a tag to compare

@rich-iannone rich-iannone released this 20 Jul 18:47
d51fea9

Greenwood v0.3.0 is a substantial release focused on model evaluation, visualization, and statistical inference. It introduces time-dependent AUC for discrimination assessment across multiple horizons, forest plots for Cox hazard ratios, cumulative incidence function (CIF) plots for competing risks, and stratified RMST comparisons with inverse-variance pooling. Univariate parametric distribution fitting and extended AFT predictions round out the modeling improvements, while stratified k-fold cross-validation ensures honest performance estimates even with imbalanced event rates.

New Features

  • Time-dependent AUC — The new time_dependent_auc() function computes the Uno IPCW-weighted cumulative/dynamic AUC at specified time horizons, providing a discrimination summary that accounts for the time-varying nature of survival predictions. (#8)

  • Forest plots — The new plot_forest() function renders hazard-ratio plots with confidence intervals from fitted CoxPH models or RMSTResult objects. Supports both the Altair and plotnine backends. (#6)

  • CIF plots — The new plot_cif() function visualizes cumulative incidence functions from fitted AalenJohansen objects, with optional risk tables and per-group stratification for competing-risks analyses. (#10)

  • Univariate parametric models — The new Parametric class fits a single parametric survival distribution (Weibull, exponential, log-normal, log-logistic) to right-censored data by maximum likelihood, without covariates. The companion compare_distributions() helper fits all four families and returns an AIC/BIC comparison table for distribution selection. (#9)

  • Stratified RMST comparisonrmst_test() and rmst_diff() now accept a strata= argument for stratified group comparisons. Per-stratum RMST estimates are combined via inverse-variance pooling, matching the survRM2 reference implementation. (#5)

Enhancements

  • AFT.predict() now supports three additional prediction types: "mean" (expected survival time), "mean_remaining" (mean residual life at a given time), and "rmst" (restricted mean survival time up to a user-supplied tau). (#7)

  • AalenJohansen now accepts a conf_type= parameter ("plain", "log", "log-log") to control the confidence interval transformation for cumulative incidence estimates, consistent with R's survfit. (#11)

  • cross_validate() now uses stratified k-fold splitting by default (stratified=True), ensuring each fold preserves the overall event proportion. This prevents singular matrix errors and biased CV estimates on imbalanced survival data. (#12)