DEV Community

TildAlice
TildAlice

Posted on • Originally published at tildalice.io

lifelines vs scikit-survival: Cox Model Speed on 5K Patients

Most survival analysis tutorials skip the part where your Cox model takes 40 minutes to fit

I ran the same clinical dataset through both lifelines and scikit-survival and the speed difference was embarrassing. Not a 10% gap — a 12x gap on a relatively modest 5,000-patient dataset with 15 covariates. If you're choosing a survival analysis library based on which one has better documentation (lifelines wins there), you might be setting yourself up for pain when you scale beyond toy examples.

Here's what actually matters: API ergonomics vs computational efficiency. lifelines feels like pandas — intuitive, fluent, great for exploration. scikit-survival feels like scikit-learn — verbose setup, but the underlying C++ implementation screams once you hit that .fit() call. The question isn't which is "better" — it's whether you're doing exploratory analysis on a few hundred patients or building a production risk calculator that needs to retrain weekly on 50K+ records.

Let me show you where each library wins and where each falls apart.


A detailed flat lay of essential survival tools for outdoor adventure and tactical use.

Photo by Marta Branco on Pexels

Continue reading the full article on TildAlice

Top comments (0)