v0.3.0
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 fittedCoxPHmodels orRMSTResultobjects. Supports both the Altair and plotnine backends. (#6) -
CIF plots — The new
plot_cif()function visualizes cumulative incidence functions from fittedAalenJohansenobjects, with optional risk tables and per-group stratification for competing-risks analyses. (#10) -
Univariate parametric models — The new
Parametricclass fits a single parametric survival distribution (Weibull, exponential, log-normal, log-logistic) to right-censored data by maximum likelihood, without covariates. The companioncompare_distributions()helper fits all four families and returns an AIC/BIC comparison table for distribution selection. (#9) -
Stratified RMST comparison —
rmst_test()andrmst_diff()now accept astrata=argument for stratified group comparisons. Per-stratum RMST estimates are combined via inverse-variance pooling, matching thesurvRM2reference 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-suppliedtau). (#7) -
AalenJohansennow accepts aconf_type=parameter ("plain","log","log-log") to control the confidence interval transformation for cumulative incidence estimates, consistent with R'ssurvfit. (#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)