Skip to content

Releases: CamDavidsonPilon/lifelines

v0.15.1

23 Nov 16:31
8d7343e
Compare
Choose a tag to compare

0.15.1

  • Bug fixes for v0.15.0
  • Raise NotImplementedError if the robust flag is used in CoxTimeVaryingFitter - that's not ready yet.

v0.15.0

22 Nov 21:57
fc97807
Compare
Choose a tag to compare
  • adding robust params to CoxPHFitter's fit. This enables atleast i) using non-integer weights in the model (these could be sampling weights like IPTW), and ii) mis-specified models (ex: non-proportional hazards). Under the hood it's a sandwich estimator. This does not handle ties, so if there are high number of ties, results may significantly differ from other software.
  • standard_errors_ is now a property on fitted CoxPHFitter which describes the standard errors of the coefficients.
  • variance_matrix_ is now a property on fitted CoxPHFitter which describes the variance matrix of the coefficients.
  • new criteria for convergence of CoxPHFitter and CoxTimeVaryingFitter called the Newton-decrement. Tests show it is as accurate (w.r.t to previous coefficients) and typically shaves off a single step, resulting in generally faster convergence. See https://www.cs.cmu.edu/~pradeepr/convexopt/Lecture_Slides/Newton_methods.pdf. Details about the Newton-decrement are added to the show_progress statements.
  • Minimum suppport for scipy is 1.0
  • Convergence errors in models that use Newton-Rhapson methods now throw a ConvergenceError, instead of a ValueError (the former is a subclass of the latter, however).
  • AalenAdditiveModel raises ConvergenceWarning instead of printing a warning.
  • KaplanMeierFitter now has a cumulative plot option. Example kmf.plot(invert_y_axis=True)
  • a weights_col option has been added to CoxTimeVaryingFitter that allows for time-varying weights.
  • WeibullFitter has a new show_progress param and additional information if the convergence fails.
  • CoxPHFitter, ExponentialFitter, WeibullFitter and CoxTimeVaryFitter method print_summary is updated with new fields.
  • WeibullFitter has renamed the incorrect _jacobian to _hessian_.
  • variance_matrix_ is now a property on fitted WeibullFitter which describes the variance matrix of the parameters.
  • The default WeibullFitter().timeline has changed from integers between the min and max duration to n floats between the max and min durations, where n is the number of observations.
  • Performance improvements for CoxPHFitter (~20% faster)
  • Performance improvements for CoxTimeVaryingFitter (~100% faster)
  • In Python3, Univariate models are now serialisable with pickle. Thanks @dwilson1988 for the contribution. For Python2, dill is still the preferred method.
  • baseline_cumulative_hazard_ (and derivatives of that) on CoxPHFitter now correctly incorporate the weights_col.
  • Fixed a bug in KaplanMeierFitter when late entry times lined up with death events. Thanks @pzivich
  • Adding cluster_col argument to CoxPHFitter so users can specify groups of subjects/rows that may be correlated.
  • Shifting the "signficance codes" for p-values down an order of magnitude. (Example, p-values between 0.1 and 0.05 are not noted at all and p-values between 0.05 and 0.1 are noted with ., etc.). This deviates with how they are presented in other software. There is an argument to be made to remove p-values from lifelines altogether (become the changes you want to see in the world lol), but I worry that people could compute the p-values by hand incorrectly, a worse outcome I think. So, this is my stance. P-values between 0.1 and 0.05 offer very little information, so they are removed. There is a growing movement in statistics to shift "signficant" findings to p-values less than 0.01 anyways.
  • New fitter for cumulative incidence of multiple risks AalenJohansenFitter. Thanks @pzivich! See "Methodologic Issues When Estimating Risks in Pharmacoepidemiology" for a nice overview of the model.

v0.14.6

02 Jul 17:14
0db4472
Compare
Choose a tag to compare

0.14.6

  • fix for n > 2 groups in multivariate_logrank_test (again).
  • fix bug for when event_observed column was not boolean.

v0.14.5

30 Jun 01:27
b4abbab
Compare
Choose a tag to compare

0.14.5

  • fix for n > 2 groups in multivariate_logrank_test
  • fix weights in KaplanMeierFitter when using a pandas Series.

v0.14.4

14 Jun 19:43
e7c7ede
Compare
Choose a tag to compare

0.14.4

  • Adds baseline_cumulative_hazard_ and baseline_survival_ to CoxTimeVaryingFitter. Because of this, new prediction methods are available.
  • fixed a bug in add_covariate_to_timeline when using cumulative_sum with multiple columns.
  • Added Likelihood ratio test to CoxPHFitter.print_summary and CoxTimeVaryingFitter.print_summary
  • New checks in CoxTimeVaryingFitter that check for immediate deaths and redundant rows.
  • New delay parameter in add_covariate_to_timeline
  • removed two_sided_z_test from statistics

v0.14.3

24 May 15:24
c1bc505
Compare
Choose a tag to compare

0.14.3

  • fixes a bug when subtracting or dividing two UnivariateFitters with labels.
  • fixes an import error with using CoxTimeVaryingFitter predict methods.
  • adds a column argument to CoxTimeVaryingFitter and CoxPHFitter plot method to plot only a subset of columns.

v0.14.2

19 May 03:12
cd7bb5c
Compare
Choose a tag to compare

Some quality of life improvements

v0.14.1

01 Apr 13:36
12128c0
Compare
Choose a tag to compare

0.14.1

  • fixed bug with using weights and strata in CoxPHFitter
  • fixed bug in using non-integer weights in KaplanMeierFitter
  • Performance optimizations in CoxPHFitter for up to 40% faster completion of fit.
    • even smarter step_size calculations for iterative optimizations.
    • simple code optimizations & cleanup in specific hot spots.
  • Performance optimizations in AalenAdditiveFitter for up to 50% faster completion of fit for large dataframes, and up to 10% faster for small dataframes.

v0.14

04 Mar 00:08
bbd7e5a
Compare
Choose a tag to compare
  • adding plot_covariate_groups to CoxPHFitter to visualize what happens to survival as we vary a covariate, all else being equal.
  • utils functions like qth_survival_times and median_survival_times now return the transpose of the DataFrame compared to previous version of lifelines. The reason for this is that we often treat survival curves as columns in DataFrames, and functions of the survival curve as index (ex: KaplanMeierFitter.survival_function_ returns a survival curve at time t).
  • KaplanMeierFitter.fit and NelsonAalenFitter.fit accept a weights vector that can be used for pre-aggregated datasets. See this issue.
  • Convergence errors now return a custom ConvergenceWarning instead of a RuntimeWarning
  • New checks for complete separation in the dataset for regressions.

v0.13

22 Dec 21:44
Compare
Choose a tag to compare

0.13.0

  • Implements a new fitter CoxTimeVaryingFitter available under the lifelines namespace. This model implements the Cox model for time-varying covariates.
  • Utils for creating time varying datasets available in utils.
  • CoxPHFitter.fit now has accepts a weight_col kwarg so one can pass in weights per observation. This is very useful if you have many subjects, and the space of covariates is not large. Thus you can group the same subjects together and give that observation a weight equal to the count. Altogether, this means a much faster regression.
  • removes is_significant and test_result from StatisticalResult. Users can instead choose their significance level by comparing to p_value. The string representation of this class has changed aswell.
  • CoxPHFitter and AalenAdditiveFitter now have a score_ property that is the concordance-index of the dataset to the fitted model.
  • CoxPHFitter has a slightly more intelligent (barely...) way to pick a step size, so convergence should generally be faster.
  • CoxPHFitter and AalenAdditiveFitter no longer have the data property. It was an almost duplicate of the training data, but was causing the model to be very large when serialized.
  • less noisy check for complete separation.
  • removed datasets namespace from the main lifelines namespace