CamDavidsonPilon / lifelines

Survival analysis in Python
lifelines.readthedocs.org
MIT License
2.38k stars 560 forks source link

Stratified K-fold CV #1631

Open anbai106 opened 3 months ago

anbai106 commented 3 months ago

Hi team,

I found that when you fit a very imbalanced dataset, the CoxPHFitter models led to a singular error because the k_fold_cross_validation does not ensure the folds include both case & non-case participants.

Do you have any solution for this or are you going to implement Sklearn stratified K-fold CV?

Thanks