Skip to content

Commit 562e00e

Browse files
update dataset
1 parent db672ab commit 562e00e

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
##### Bug fixes
66
- Fixed bug when no covariates were passed into `CoxPHFitter`. See #975
77
- Fixed error in `StatisticalResult` where the test name was not displayed correctly.
8+
- Fixed a keyword bug in `plot_covariate_groups` for parametric models.
89

910

1011
#### 0.24.1 - 2020-03-05
@@ -18,15 +19,15 @@
1819

1920
#### 0.24.0 - 2020-02-20
2021

21-
This version and future versions of lifelines no longer support py35. Pandas 1.0 is fully supported, along with previous version. Minimum Scipy has been bumped to 1.2.0
22+
This version and future versions of lifelines no longer support py35. Pandas 1.0 is fully supported, along with previous versions. Minimum Scipy has been bumped to 1.2.0.
2223

2324
##### New features
2425
- `CoxPHFitter` and `CoxTimeVaryingFitter` has support for an elastic net penalty, which includes L1 and L2 regression.
2526
- `CoxPHFitter` has new baseline survival estimation methods. Specifically, `spline` now estimates the coefficients and baseline survival using splines. The traditional method, `breslow`, is still the default however.
2627
- Regression models have a new `score` method that will score your model against a dataset (ex: a testing or validation dataset). The default is to evaluate the log-likelihood, but also the concordance index can be chose.
2728
- New `MixtureCureFitter` for quickly creating univariate mixture models.
2829
- Univariate parametric models have a `plot_density`, `density_at_times`, and property `density_` that computes the probability density function estimates.
29-
- new dataset for interval regression involving C. Botulinum.
30+
- new dataset for interval regression involving *C. Botulinum*.
3031
- new `lifelines.fitters.mixins.ProportionalHazardMixin` that implements proportional hazard checks.
3132

3233
##### API Changes

lifelines/datasets/c_botulinum_lag_phase.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
NaCL %,pH,lower_bound_days,upper_bound_days
1+
NaCl %,pH,lower_bound_days,upper_bound_days
22
0,7.0,0,1.0
33
0,6.5,0,1.0
44
0,6.0,0,1.0

lifelines/fitters/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,7 +2407,7 @@ def plot(self, columns=None, parameter=None, ax=None, **errorbar_kwargs):
24072407

24082408
return ax
24092409

2410-
def plot_covariate_groups(self, covariates, values, plot_baseline=True, ax=None, timeline=None, **kwargs):
2410+
def plot_covariate_groups(self, covariates, values, plot_baseline=True, ax=None, times=None, **kwargs):
24112411
"""
24122412
Produces a plot comparing the baseline survival curve of the model versus
24132413
what happens when a covariate(s) is varied over values in a group. This is useful to compare
@@ -2422,8 +2422,8 @@ def plot_covariate_groups(self, covariates, values, plot_baseline=True, ax=None,
24222422
an iterable of the values we wish the covariate to take on.
24232423
plot_baseline: bool
24242424
also display the baseline survival, defined as the survival at the mean of the original dataset.
2425-
timeline:
2426-
pass in a timeline to plot
2425+
times:
2426+
pass in a times to plot
24272427
kwargs:
24282428
pass in additional plotting commands
24292429
@@ -2481,9 +2481,9 @@ def plot_covariate_groups(self, covariates, values, plot_baseline=True, ax=None,
24812481
for covariate, value in zip(covariates, values.T):
24822482
X[covariate] = value
24832483

2484-
self.predict_survival_function(X, timeline=timeline).plot(ax=ax, **kwargs)
2484+
self.predict_survival_function(X, times=times).plot(ax=ax, **kwargs)
24852485
if plot_baseline:
2486-
self.predict_survival_function(x_bar, timeline=timeline).rename(columns={0: "baseline survival"}).plot(
2486+
self.predict_survival_function(x_bar, times=times).rename(columns={0: "baseline survival"}).plot(
24872487
ax=ax, ls=":", color="k"
24882488
)
24892489
return ax
@@ -3113,7 +3113,7 @@ def plot(self, columns=None, parameter=None, ax=None, **errorbar_kwargs):
31133113

31143114
return ax
31153115

3116-
def plot_covariate_groups(self, covariates, values, plot_baseline=True, ax=None, timeline=None, **kwargs):
3116+
def plot_covariate_groups(self, covariates, values, plot_baseline=True, ax=None, times=None, **kwargs):
31173117
"""
31183118
Produces a visual representation comparing the baseline survival curve of the model versus
31193119
what happens when a covariate(s) is varied over values in a group. This is useful to compare
@@ -3128,8 +3128,8 @@ def plot_covariate_groups(self, covariates, values, plot_baseline=True, ax=None,
31283128
an iterable of the values we wish the covariate to take on.
31293129
plot_baseline: bool
31303130
also display the baseline survival, defined as the survival at the mean of the original dataset.
3131-
timeline: iterable
3132-
pass in a timeline to plot
3131+
times: iterable
3132+
pass in a times to plot
31333133
kwargs:
31343134
pass in additional plotting commands
31353135
@@ -3194,9 +3194,9 @@ def plot_covariate_groups(self, covariates, values, plot_baseline=True, ax=None,
31943194
X["_intercept"] = 1.0
31953195
ancillary_X["_intercept"] = 1.0
31963196

3197-
self.predict_survival_function(X, ancillary_df=ancillary_X, timeline=timeline).plot(ax=ax, **kwargs)
3197+
self.predict_survival_function(X, ancillary_df=ancillary_X, times=times).plot(ax=ax, **kwargs)
31983198
if plot_baseline:
3199-
self.predict_survival_function(x_bar, ancillary_df=x_bar_anc, timeline=timeline).rename(
3199+
self.predict_survival_function(x_bar, ancillary_df=x_bar_anc, times=times).rename(
32003200
columns={0: "baseline survival"}
32013201
).plot(ax=ax, ls=":", color="k")
32023202
return ax

0 commit comments

Comments
 (0)