lifelines 0.29.0__py3-none-any.whl → 0.30.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2991,7 +2991,11 @@ class ParametricSplinePHFitter(ParametricCoxModelFitter, SplineFitterMixin):
2991
2991
 
2992
2992
  @staticmethod
2993
2993
  def _strata_labeler(stratum, i):
2994
- return "s%s_phi%d_" % (stratum, i)
2994
+ try:
2995
+ return "s%s_phi%d_" % (tuple(str(s) for s in stratum), i)
2996
+ except:
2997
+ # singleton
2998
+ return "s%s_phi%d_" % (stratum, i)
2995
2999
 
2996
3000
  @property
2997
3001
  def _fitted_parameter_names(self):
@@ -3112,7 +3116,11 @@ class ParametricPiecewiseBaselinePHFitter(ParametricCoxModelFitter, Proportional
3112
3116
 
3113
3117
  @staticmethod
3114
3118
  def _strata_labeler(stratum, i):
3115
- return "s%s_lambda%d_" % (stratum, i)
3119
+ try:
3120
+ return "s%s_lambda%d_" % (tuple(str(s) for s in stratum), i)
3121
+ except:
3122
+ # singleton
3123
+ return "s%s_lambda%d_" % (stratum, i)
3116
3124
 
3117
3125
  @property
3118
3126
  def _fitted_parameter_names(self):
lifelines/statistics.py CHANGED
@@ -111,14 +111,14 @@ class StatisticalResult:
111
111
 
112
112
  """
113
113
  if style is not None:
114
- self._print_specific_style(style)
114
+ self._print_specific_style(style, decimals=decimals, **kwargs)
115
115
  else:
116
116
  try:
117
117
  from IPython.display import display
118
118
 
119
119
  display(self)
120
120
  except ImportError:
121
- self._ascii_print()
121
+ self._ascii_print(decimals=decimals, **kwargs)
122
122
 
123
123
  def _html_print(self, decimals=2, **kwargs):
124
124
  print(self.to_html(decimals, **kwargs))
@@ -835,7 +835,7 @@ def multivariate_logrank_test(
835
835
  assert abs(Z_j.sum()) < 10e-8, "Sum is not zero." # this should move to a test eventually.
836
836
 
837
837
  # compute covariance matrix
838
- factor = (((n_i - d_i) / (n_i - 1)).replace([np.inf, np.nan], 1)) * d_i / n_i ** 2
838
+ factor = (((n_i - d_i) / (n_i - 1)).replace([np.inf, np.nan], 1)) * d_i / n_i**2
839
839
  n_ij["_"] = n_i.values
840
840
  V_ = (n_ij.mul(w_i, axis=0)).mul(np.sqrt(factor), axis="index").fillna(0) # weighted V_
841
841
  V = -np.dot(V_.T, V_)
@@ -923,7 +923,7 @@ def proportional_hazard_test(
923
923
  def compute_statistic(times, resids, n_deaths):
924
924
  demeaned_times = times - times.mean()
925
925
  T = (demeaned_times.values[:, None] * resids.values).sum(0) ** 2 / (
926
- n_deaths * (fitted_cox_model.standard_errors_ ** 2) * (demeaned_times ** 2).sum()
926
+ n_deaths * (fitted_cox_model.standard_errors_**2) * (demeaned_times**2).sum()
927
927
  )
928
928
  return T
929
929
 
lifelines/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  from __future__ import unicode_literals
3
3
 
4
- __version__ = "0.29.0"
4
+ __version__ = "0.30.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lifelines
3
- Version: 0.29.0
3
+ Version: 0.30.0
4
4
  Summary: Survival analysis in Python, including Kaplan Meier, Nelson Aalen and regression
5
5
  Home-page: https://github.com/CamDavidsonPilon/lifelines
6
6
  Author: Cameron Davidson-Pilon
@@ -16,13 +16,13 @@ Classifier: Topic :: Scientific/Engineering
16
16
  Requires-Python: >=3.9
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
- Requires-Dist: numpy <2.0,>=1.14.0
20
- Requires-Dist: scipy >=1.7.0
21
- Requires-Dist: pandas >=2.1
22
- Requires-Dist: matplotlib >=3.0
23
- Requires-Dist: autograd >=1.5
24
- Requires-Dist: autograd-gamma >=0.3
25
- Requires-Dist: formulaic >=0.2.2
19
+ Requires-Dist: numpy>=1.14.0
20
+ Requires-Dist: scipy>=1.7.0
21
+ Requires-Dist: pandas>=2.1
22
+ Requires-Dist: matplotlib>=3.0
23
+ Requires-Dist: autograd>=1.5
24
+ Requires-Dist: autograd-gamma>=0.3
25
+ Requires-Dist: formulaic>=0.2.2
26
26
 
27
27
  ![](http://i.imgur.com/EOowdSD.png)
28
28
 
@@ -3,8 +3,8 @@ lifelines/calibration.py,sha256=Luii7bkJ2YB0jpuOYYhI22aUyEc1gLsS10Pno6Sqo98,4113
3
3
  lifelines/exceptions.py,sha256=8T1vQuI6Fnf_5OfiJahksn5Soe-SmU9Y2IA7HYen460,577
4
4
  lifelines/generate_datasets.py,sha256=nwGVpkcVRKH70N8z0Z-y7GgetX8suZZ1FFmdjOB8tBs,10188
5
5
  lifelines/plotting.py,sha256=sQmwpSziHzVQoWoe_gll4LInrjg-E4FpeWMp07wurNo,35069
6
- lifelines/statistics.py,sha256=cOszUYz87elnbTAt6V3fTrHwPjB9HFI1hxjLvKypS6k,35129
7
- lifelines/version.py,sha256=pYOd-rP1moJefUJJ6DbkYBuzORUtOVDOBiCBT13-usg,88
6
+ lifelines/statistics.py,sha256=dDLPz2FNZEI1PNkL9pfAfQToXSvrDgXdOxQsoluTw5o,35179
7
+ lifelines/version.py,sha256=fKPI8YV9Pdykklk91EAQOagw8PwkZHylDK82XMhvDjI,88
8
8
  lifelines/datasets/CuZn-LeftCensoredDataset.csv,sha256=PxTdZcJPPbhtaadpHjhMFVcUxmSn84BuDarujZIJpm4,1996
9
9
  lifelines/datasets/__init__.py,sha256=wiKbbNj-SSrgk_jysTdeQo1ceCmHXKje8WIzwBJAH_E,19977
10
10
  lifelines/datasets/anderson.csv,sha256=nTAtTK8mf0ymU88nKvO2Fj0WL9SE9o4S0GVujmX8Cl4,580
@@ -40,7 +40,7 @@ lifelines/fitters/aalen_additive_fitter.py,sha256=xca1uoNbuPS2YoGQ73GYa5JLZTLCt9
40
40
  lifelines/fitters/aalen_johansen_fitter.py,sha256=w_2MV7Bbtr0swJ0VdySqirhlGsjbYyqduRx9iLKd6XA,14172
41
41
  lifelines/fitters/breslow_fleming_harrington_fitter.py,sha256=_86qU3wMHEyuCKLjhHLERP_ymNnlSvi7chWgi8Kygxg,4293
42
42
  lifelines/fitters/cox_time_varying_fitter.py,sha256=cZo9opn4OdFajrj6aBxJDhgWvFIUHdsq7jpgMQ0HchU,34670
43
- lifelines/fitters/coxph_fitter.py,sha256=zbmwmO1EyHy-19ijuMkF_RCb7dG_VB7DBH7qArHar6w,136920
43
+ lifelines/fitters/coxph_fitter.py,sha256=s4mWI1rj_kpsq2_kBa0Shg_FphBeIeJCEdW86aSFCls,137177
44
44
  lifelines/fitters/crc_spline_fitter.py,sha256=FUaiz4O-Hdke7T5dV8RCl-27oWxrMJLBSXxnRN4QkGQ,3126
45
45
  lifelines/fitters/exponential_fitter.py,sha256=Fbb1rtBOrHb_YxFYidzqXcFw7aWsqet_2vqi7s8WJ4U,2857
46
46
  lifelines/fitters/generalized_gamma_fitter.py,sha256=OiXO9onvYtI2gNvUoxF4mjEjbj7IRZl5R4UZ_RzrSjo,6482
@@ -65,8 +65,8 @@ lifelines/utils/concordance.py,sha256=hWXrmg1BiK2Hqu9CRzlvkPlnlmZqZcAxH7L1PjaqdC
65
65
  lifelines/utils/lowess.py,sha256=MMydVcnbxqIgsiNcIgVUFtlFycD7v3ezwEGpituvBHs,2541
66
66
  lifelines/utils/printer.py,sha256=-nXxu02gs0kaKfoQQ65sH-I45tGmgoFeOOIUSEc53iE,5861
67
67
  lifelines/utils/safe_exp.py,sha256=HCCAkwQTx6G2qRC03v9Q_GWqVj8at1Eac1JVrMgS9hg,4350
68
- lifelines-0.29.0.dist-info/LICENSE,sha256=AasDeD139SnTdfXbKgN4BMyMgBlRy9YFs60tNrB4wf0,1079
69
- lifelines-0.29.0.dist-info/METADATA,sha256=JOhlJ11AqPSdC2P1z8KNg_Sh4mhCj9f7ymMBz85cZi8,3187
70
- lifelines-0.29.0.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
71
- lifelines-0.29.0.dist-info/top_level.txt,sha256=3i57Z4mtpc6jWrsW0n-_o9Y7CpzytMTeLMPJBHYAo0o,10
72
- lifelines-0.29.0.dist-info/RECORD,,
68
+ lifelines-0.30.0.dist-info/LICENSE,sha256=AasDeD139SnTdfXbKgN4BMyMgBlRy9YFs60tNrB4wf0,1079
69
+ lifelines-0.30.0.dist-info/METADATA,sha256=KvpZHV7x8L87MWq3rkiDWekouWFvOp0dzUoPKHUfxk4,3175
70
+ lifelines-0.30.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
71
+ lifelines-0.30.0.dist-info/top_level.txt,sha256=3i57Z4mtpc6jWrsW0n-_o9Y7CpzytMTeLMPJBHYAo0o,10
72
+ lifelines-0.30.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.1.1)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5