v0.25.0
·
346 commits
to master
since this release
0.25.0 - 2020-07-27
New features
- Formulas! lifelines now supports R-like formulas in regression models. See docs here.
plot_covariate_groupnow can plot other y-values like hazards and cumulative hazards (default: survival function).CoxPHFitternow accepts late entries viaentry_col.calibration.survival_probability_calibrationnow works with out-of-sample data.print_summarynow accepts acolumnargument to filter down the displayed values. This helps with clutter in notebooks, latex, or on the terminal.add_at_risk_countsnow follows the cool new KMunicate suggestions
API Changes
- With the introduction of formulas, all models can be using formulas under the hood.
- For both custom regression models or non-AFT regression models, this means that you no longer need to add a constant column to your DataFrame (instead add a
1as a formula string in theregressorsdict). You may also need to remove the T and E columns fromregressors. I've updated the models in the\examplesfolder with examples of this new model building.
- For both custom regression models or non-AFT regression models, this means that you no longer need to add a constant column to your DataFrame (instead add a
- Unfortunately, if using formulas, your model will not be able to be pickled. This is a problem with an upstream library, and I hope to have it resolved in the near future.
plot_covariate_groupshas been deprecated in favour ofplot_partial_effects_on_outcome.- The baseline in
plot_covariate_groupshas changed from the mean observation (including dummy-encoded categorical variables) to median for ordinal (including continuous) and mode for categorical. - Previously, lifelines used the label
"_intercept"to when it added a constant column in regressions. To align with Patsy, we are now using"Intercept". - In AFT models,
ancillary_dfkwarg has been renamed toancillary. This reflects the more general use of the kwarg (not always a DataFrame, but could be a boolean or string now, too). - Some column names in datasets shipped with lifelines have changed.
- The never used "lifelines.metrics" is deleted.
- With the introduction of formulas,
plot_covariate_groups(now calledplot_partial_effects_on_outcome) behaves differently for transformed variables. Users no longer need to add "derivatives" features, and encoding is done implicitly. See docs here. - all exceptions and warnings have moved to
lifelines.exceptions
Bug fixes
- The p-value of the log-likelihood ratio test for the CoxPHFitter with splines was returning the wrong result because the degrees of freedom was incorrect.
- better
print_summarylogic in IDEs and Jupyter exports. Previously it should not be displayed. - p-values have been corrected in the
SplineFitter. Previously, the "null hypothesis" was no coefficient=0, but coefficient=0.01. This is now set to the former. - fixed NaN bug in
survival_table_from_eventswith intervals when no events would occur in a interval.