From adf37ea88597e519d5cfca8ad1163806b74c054e Mon Sep 17 00:00:00 2001 From: CamDavidsonPilon Date: Fri, 23 Sep 2022 10:32:57 -0400 Subject: [PATCH 1/5] Fix latex issues --- CHANGELOG.md | 9 +++++++++ lifelines/statistics.py | 35 ++++++++++++++++++++--------------- lifelines/utils/printer.py | 18 ++++++++++-------- lifelines/version.py | 2 +- 4 files changed, 40 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9c0005d5..e7a438a7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ ## Changelog +#### 0.27.3 - Upcoming + +##### Bug fixes + - Migrate to newer Pandas `Styler` for `to_latex` + +##### API Changes + - There were way too many functions on the summary objects, so I've hidden `to_*` on them. + + #### 0.27.2 - 2022-09-07 ##### Bug fixes diff --git a/lifelines/statistics.py b/lifelines/statistics.py index 9882674ed..e7b227876 100644 --- a/lifelines/statistics.py +++ b/lifelines/statistics.py @@ -77,7 +77,7 @@ def __init__(self, p_value, test_statistic, name=None, test_name=None, **kwargs) kwargs["test_name"] = test_name self._kwargs = kwargs - def print_specific_style(self, style, decimals=2, **kwargs): + def _print_specific_style(self, style, decimals=2, **kwargs): """ Parameters ----------- @@ -87,40 +87,48 @@ def print_specific_style(self, style, decimals=2, **kwargs): """ if style == "html": - return self.html_print(decimals=decimals, **kwargs) + return self._html_print(decimals=decimals, **kwargs) elif style == "ascii": - return self.ascii_print(decimals=decimals, **kwargs) + return self._ascii_print(decimals=decimals, **kwargs) elif style == "latex": - return self.latex_print(decimals=decimals, **kwargs) + return self._latex_print(decimals=decimals, **kwargs) else: raise ValueError("style not available.") def print_summary(self, decimals=2, style=None, **kwargs): """ - Print summary statistics describing the fit, the coefficients, and the error bounds. + Print summary statistics describing the results. Parameters ----------- decimals: int, optional (default=2) specify the number of decimal places to show + style: string, + {html, ascii, latex}, default ascii kwargs: print additional meta data in the output (useful to provide model names, dataset names, etc.) when comparing multiple outputs. """ if style is not None: - self.print_specific_style(style) + self._print_specific_style(style) else: try: from IPython.display import display display(self) except ImportError: - self.ascii_print() + self._ascii_print() - def html_print(self, decimals=2, **kwargs): + def _html_print(self, decimals=2, **kwargs): print(self.to_html(decimals, **kwargs)) + def _latex_print(self, decimals=2, **kwargs): + print(self.to_latex(decimals, **kwargs)) + + def _ascii_print(self, decimals=2, **kwargs): + print(self.to_ascii(decimals, **kwargs)) + def to_html(self, decimals=2, **kwargs): extra_kwargs = dict(list(self._kwargs.items()) + list(kwargs.items())) summary_df = self.summary @@ -136,11 +144,11 @@ def to_html(self, decimals=2, **kwargs): return header_html + summary_html - def latex_print(self, decimals=2, **kwargs): - print(self.to_latex(decimals, **kwargs)) - def to_latex(self, decimals=2, **kwargs): - return self.summary.to_latex() + # This is using the new Style object in Pandas. Previously df.to_latex was giving a warning. + s = self.summary.style + s = s.format(precision=decimals) + return s.to_latex() @property def summary(self): @@ -196,9 +204,6 @@ def __add__(self, other): kwargs = dict(list(self._kwargs.items()) + list(other._kwargs.items())) return StatisticalResult(p_values, test_statistics, name=names, **kwargs) - def ascii_print(self, decimals=2, **kwargs): - print(self.to_ascii(decimals, **kwargs)) - def _repr_latex_(self): return self.to_latex() diff --git a/lifelines/utils/printer.py b/lifelines/utils/printer.py index 742a26f27..202d6735e 100644 --- a/lifelines/utils/printer.py +++ b/lifelines/utils/printer.py @@ -31,11 +31,11 @@ def add_to_headers(self, tuple_): def print_specific_style(self, style): if style == "html": - return self.html_print() + return self._html_print() elif style == "ascii": - return self.ascii_print() + return self._ascii_print() elif style == "latex": - return self.latex_print() + return self._latex_print() else: raise ValueError("style not available.") @@ -48,9 +48,9 @@ def print(self, style=None): display(self) except ImportError: - self.ascii_print() + self._ascii_print() - def latex_print(self): + def _latex_print(self): print(self.to_latex()) def to_latex(self): @@ -59,9 +59,11 @@ def to_latex(self): columns = summary_df.columns else: columns = summary_df.columns.intersection(self.columns) - return summary_df[columns].to_latex(float_format="%." + str(self.decimals) + "f") + s = summary_df[columns].style + s = s.format(precision=self.decimals) + return s.to_latex() - def html_print(self): + def _html_print(self): print(self.to_html()) def to_html(self): @@ -174,7 +176,7 @@ def to_ascii(self): repr_string += "{} = {}".format(string, value) + "\n" return repr_string - def ascii_print(self): + def _ascii_print(self): print(self.to_ascii()) def _repr_latex_( diff --git a/lifelines/version.py b/lifelines/version.py index a8f10fce1..72c53c209 100644 --- a/lifelines/version.py +++ b/lifelines/version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -__version__ = "0.27.2" +__version__ = "0.27.3" From a24ba9a644f1ad5060409f31eef3562b9c57af63 Mon Sep 17 00:00:00 2001 From: CamDavidsonPilon Date: Sun, 25 Sep 2022 15:46:29 -0400 Subject: [PATCH 2/5] not ready for 3.11 due to autograd, silence lots of warnings, update pandas --- .pre-commit-config.yaml | 4 +-- lifelines/fitters/__init__.py | 22 ++++++------ lifelines/fitters/cox_time_varying_fitter.py | 21 ++++++------ lifelines/fitters/coxph_fitter.py | 36 ++++++++++---------- lifelines/tests/test_estimation.py | 19 +++++------ lifelines/utils/__init__.py | 20 +++++++---- setup.py | 2 +- 7 files changed, 66 insertions(+), 58 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 659d2533c..598502d10 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.3.0 hooks: - id: trailing-whitespace - id: check-ast @@ -10,7 +10,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/ambv/black - rev: 21.6b0 + rev: 22.8.0 hooks: - id: black args: ["--line-length", "130"] diff --git a/lifelines/fitters/__init__.py b/lifelines/fitters/__init__.py index f33d70b64..a409a6b15 100644 --- a/lifelines/fitters/__init__.py +++ b/lifelines/fitters/__init__.py @@ -1933,16 +1933,18 @@ def _fit_model( if _initial_point.shape[0] != Xs.columns.size: raise ValueError("initial_point is not the correct shape.") - results = minimize( - # using value_and_grad is much faster (takes advantage of shared computations) than splitting. - value_and_grad(self._neg_likelihood_with_penalty_function), - _initial_point, - method=self._scipy_fit_method, - jac=True, - args=(Ts, E, weights, entries, utils.DataframeSlicer(Xs)), - options={**{"disp": show_progress}, **self._scipy_fit_options, **fit_options}, - callback=self._scipy_fit_callback, - ) + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + results = minimize( + # using value_and_grad is much faster (takes advantage of shared computations) than splitting. + value_and_grad(self._neg_likelihood_with_penalty_function), + _initial_point, + method=self._scipy_fit_method, + jac=True, + args=(Ts, E, weights, entries, utils.DataframeSlicer(Xs)), + options={**{"disp": show_progress}, **self._scipy_fit_options, **fit_options}, + callback=self._scipy_fit_callback, + ) if results.fun < minimum_ll: minimum_ll, minimum_results = results.fun, results diff --git a/lifelines/fitters/cox_time_varying_fitter.py b/lifelines/fitters/cox_time_varying_fitter.py index 3b79da617..d88546d61 100644 --- a/lifelines/fitters/cox_time_varying_fitter.py +++ b/lifelines/fitters/cox_time_varying_fitter.py @@ -77,7 +77,7 @@ class CoxTimeVaryingFitter(SemiParametricRegressionFitter, ProportionalHazardMix The event_observed variable provided variance_matrix_ : DataFrame The variance matrix of the coefficients - strata: list + strata: list | str the strata provided standard_errors_: Series the standard errors of the estimates @@ -91,7 +91,7 @@ def __init__(self, alpha=0.05, penalizer=0.0, l1_ratio: float = 0.0, strata=None super(CoxTimeVaryingFitter, self).__init__(alpha=alpha) self.alpha = alpha self.penalizer = penalizer - self.strata = strata + self.strata = utils._to_list_or_singleton(strata) self.l1_ratio = l1_ratio def fit( @@ -139,7 +139,7 @@ def fit( Compute the robust errors using the Huber sandwich estimator, aka Wei-Lin estimate. This does not handle ties, so if there are high number of ties, results may significantly differ. See "The Robust Inference for the Cox Proportional Hazards Model", Journal of the American Statistical Association, Vol. 84, No. 408 (Dec., 1989), pp. 1074- 1078 - strata: list or string, optional + strata: list | string, optional specify a column or list of columns n to use in stratification. This is useful if a categorical covariate does not obey the proportional hazard assumption. This is used similar to the `strata` expression in R. @@ -161,7 +161,7 @@ def fit( self, with additional properties like ``hazards_`` and ``print_summary`` """ - self.strata = coalesce(strata, self.strata) + self.strata = utils._to_list_or_singleton(coalesce(strata, self.strata)) self.robust = robust if self.robust: raise NotImplementedError("Not available yet.") @@ -358,7 +358,7 @@ def _newton_raphson_for_efron_model( soft_abs = lambda x, a: 1 / a * (anp.logaddexp(0, -a * x) + anp.logaddexp(0, a * x)) penalizer = ( lambda beta, a: n - * (self.penalizer * (self.l1_ratio * (soft_abs(beta, a)) + 0.5 * (1 - self.l1_ratio) * (beta ** 2))).sum() + * (self.penalizer * (self.l1_ratio * (soft_abs(beta, a)) + 0.5 * (1 - self.l1_ratio) * (beta**2))).sum() ) d_penalizer = elementwise_grad(penalizer) dd_penalizer = elementwise_grad(d_penalizer) @@ -402,13 +402,13 @@ def _newton_raphson_for_efron_model( self._log_likelihood_null = ll if isinstance(self.penalizer, np.ndarray) or self.penalizer > 0: - ll -= penalizer(beta, 1.5 ** i) - g -= d_penalizer(beta, 1.5 ** i) - h[np.diag_indices(d)] -= dd_penalizer(beta, 1.5 ** i) + ll -= penalizer(beta, 1.5**i) + g -= d_penalizer(beta, 1.5**i) + h[np.diag_indices(d)] -= dd_penalizer(beta, 1.5**i) try: # reusing a piece to make g * inv(h) * g.T faster later - inv_h_dot_g_T = spsolve(-h, g, sym_pos=True) + inv_h_dot_g_T = spsolve(-h, g, assume_a="pos") except ValueError as e: if "infs or NaNs" in str(e): raise ConvergenceError( @@ -444,7 +444,8 @@ def _newton_raphson_for_efron_model( if show_progress: print( "\rIteration %d: norm_delta = %.5f, step_size = %.5f, ll = %.5f, newton_decrement = %.5f, seconds_since_start = %.1f" - % (i, norm_delta, step_size, ll, newton_decrement, time.time() - start_time)) + % (i, norm_delta, step_size, ll, newton_decrement, time.time() - start_time) + ) # convergence criteria if norm_delta < precision: diff --git a/lifelines/fitters/coxph_fitter.py b/lifelines/fitters/coxph_fitter.py index c3bf591e9..75d8b38da 100644 --- a/lifelines/fitters/coxph_fitter.py +++ b/lifelines/fitters/coxph_fitter.py @@ -150,7 +150,7 @@ def __init__( raise ValueError("l1_ratio parameter must in [0, 1].") self.penalizer = penalizer - self.strata = strata + self.strata = utils._to_list_or_singleton(strata) self.l1_ratio = l1_ratio self.baseline_estimation_method = baseline_estimation_method if knots is not None: @@ -286,7 +286,7 @@ def fit( cph.print_summary() """ - self.strata = utils.coalesce(strata, self.strata) + self.strata = utils._to_list_or_singleton(utils.coalesce(strata, self.strata)) self._model = self._fit_model( df, duration_col, @@ -429,7 +429,7 @@ def fit_interval_censoring( cph.print_summary() """ - self.strata = utils.coalesce(strata, self.strata) + self.strata = utils._to_list_or_singleton(utils.coalesce(strata, self.strata)) self._model = self._fit_model( df, (lower_bound_col, upper_bound_col), @@ -568,7 +568,7 @@ def fit_left_censoring( cph.print_summary() """ - self.strata = utils.coalesce(strata, self.strata) + self.strata = utils._to_list_or_singleton(utils.coalesce(strata, self.strata)) self._model = self._fit_model( df, duration_col, @@ -642,14 +642,14 @@ def _fit_model_piecewise(self, *args, **kwargs): kwargs.pop("batch_mode") # handle strata - strata = kwargs.pop("strata") + strata = utils._to_list_or_singleton(kwargs.pop("strata")) if strata is None: regressors = {**{"beta_": formula}, **{"log_lambda%d_" % i: "1" for i in range(2, len(self.breakpoints) + 2)}} strata_values = None elif isinstance(strata, (list, str)): strata_namer = ParametricPiecewiseBaselinePHFitter._strata_labeler - strata = utils._to_list(strata) + strata = utils._to_list_or_singleton(utils._to_list(strata)) df = df.set_index(strata).sort_index() @@ -696,14 +696,14 @@ def _fit_model_spline(self, *args, **kwargs): kwargs.pop("batch_mode") # handle strata - strata = kwargs.pop("strata") + strata = utils._to_list_or_singleton(kwargs.pop("strata")) if strata is None: regressors = {**{"beta_": formula}, **{"phi%d_" % i: "1" for i in range(1, self.n_baseline_knots + 1)}} strata_values = None elif isinstance(strata, (list, str)): strata_namer = ParametricSplinePHFitter._strata_labeler - strata = utils._to_list(strata) + strata = utils._to_list_or_singleton(utils._to_list(strata)) df = df.set_index(strata).sort_index() @@ -1085,7 +1085,7 @@ def __init__( raise ValueError("l1_ratio parameter must in [0, 1].") self.penalizer = penalizer - self.strata = strata + self.strata = utils._to_list_or_singleton(strata) self.l1_ratio = l1_ratio @utils.CensoringType.right_censoring @@ -1222,7 +1222,7 @@ def fit( self.weights_col = weights_col self._n_examples = df.shape[0] self._batch_mode = batch_mode - self.strata = utils.coalesce(strata, self.strata) + self.strata = utils._to_list_or_singleton(utils.coalesce(strata, self.strata)) self.formula = formula self.entry_col = entry_col @@ -1470,7 +1470,7 @@ def _newton_raphson_for_efron_model( soft_abs = lambda x, a: 1 / a * (anp.logaddexp(0, -a * x) + anp.logaddexp(0, a * x)) elastic_net_penalty = ( lambda beta, a: n - * (self.penalizer * (self.l1_ratio * (soft_abs(beta, a)) + 0.5 * (1 - self.l1_ratio) * (beta ** 2))).sum() + * (self.penalizer * (self.l1_ratio * (soft_abs(beta, a)) + 0.5 * (1 - self.l1_ratio) * (beta**2))).sum() ) d_elastic_net_penalty = elementwise_grad(elastic_net_penalty) dd_elastic_net_penalty = elementwise_grad(d_elastic_net_penalty) @@ -1518,9 +1518,9 @@ def _newton_raphson_for_efron_model( self._ll_null_ = ll_ if isinstance(self.penalizer, np.ndarray) or self.penalizer > 0: - ll_ -= elastic_net_penalty(beta, 1.3 ** i) - g -= d_elastic_net_penalty(beta, 1.3 ** i) - h[np.diag_indices(d)] -= dd_elastic_net_penalty(beta, 1.3 ** i) + ll_ -= elastic_net_penalty(beta, 1.3**i) + g -= d_elastic_net_penalty(beta, 1.3**i) + h[np.diag_indices(d)] -= dd_elastic_net_penalty(beta, 1.3**i) # reusing a piece to make g * inv(h) * g.T faster later try: @@ -2971,7 +2971,7 @@ class ParametricSplinePHFitter(ParametricCoxModelFitter, SplineFitterMixin): fit_intercept = True def __init__(self, strata, strata_values, n_baseline_knots=1, knots=None, *args, **kwargs): - self.strata = strata + self.strata = utils._to_list_or_singleton(strata) self.strata_values = strata_values assert ( @@ -3092,7 +3092,7 @@ class ParametricPiecewiseBaselinePHFitter(ParametricCoxModelFitter, Proportional cluster_col = None def __init__(self, strata, strata_values, breakpoints, *args, **kwargs): - self.strata = strata + self.strata = utils._to_list_or_singleton(strata) self.strata_values = strata_values assert ( @@ -3254,8 +3254,8 @@ def decide(self, batch_mode: Optional[bool], n_unique: int, n_total: int, n_vars + n_total * 4.771_387e-06 + log_frac_dups * 2.610_877e-01 + n_total * log_frac_dups * -3.830_987e-11 - + log_frac_dups ** 2 * 1.389_890e-02 - + n_total ** 2 * 3.129_870e-14 + + log_frac_dups**2 * 1.389_890e-02 + + n_total**2 * 3.129_870e-14 + n_vars * 3.196_517e-03 + n_vars * n_total * -7.356_722e-07 ) diff --git a/lifelines/tests/test_estimation.py b/lifelines/tests/test_estimation.py index 032085520..6ba9dfda4 100644 --- a/lifelines/tests/test_estimation.py +++ b/lifelines/tests/test_estimation.py @@ -1581,7 +1581,7 @@ def test_smoothing_hazard_with_spike_at_time_0(self): def test_nelson_aalen_smoothing(self): # this test was included because I was refactoring the estimators. np.random.seed(1) - N = 10 ** 4 + N = 10**4 t = np.random.exponential(1, size=N) c = np.random.binomial(1, 0.9, size=N) naf = NelsonAalenFitter(nelson_aalen_smoothing=True) @@ -2494,7 +2494,7 @@ def test_proportional_odds(self, aft, rossi): factor = aft.summary.loc[("alpha_", "prio"), "exp(coef)"] expon = aft.summary.loc[("beta_", "Intercept"), "exp(coef)"] npt.assert_allclose( - baseline_survival / (1 - baseline_survival) * factor ** expon, accelerated_survival / (1 - accelerated_survival) + baseline_survival / (1 - baseline_survival) * factor**expon, accelerated_survival / (1 - accelerated_survival) ) @@ -3365,11 +3365,10 @@ def test_that_a_convergence_warning_is_not_thrown_if_using_compute_residuals(sel cph = CoxPHFitter(penalizer=1.0) cph.fit(rossi, "week", "arrest") - with pytest.warns(None) as record: + with warnings.catch_warnings(): + warnings.simplefilter("error") cph.compute_residuals(rossi, "martingale") - assert len(record) == 0 - def test_that_adding_strata_will_change_c_index(self, cph, rossi): """ df = read.csv('~/code/lifelines/lifelines/datasets/rossi.csv') @@ -4366,16 +4365,16 @@ def test_doubling_the_weights_halves_the_variance(self, rossi): cf2 = CoxPHFitter() cf2.fit(rossi, duration_col="week", event_col="arrest") - assert_series_equal(cf2.standard_errors_ ** 2, w * cf1.standard_errors_ ** 2) + assert_series_equal(cf2.standard_errors_**2, w * cf1.standard_errors_**2) def test_adding_non_integer_weights_is_fine_if_robust_is_on(self, rossi): rossi["weights"] = np.random.exponential(1, rossi.shape[0]) cox = CoxPHFitter() - with pytest.warns(None) as w: + with warnings.catch_warnings(): + warnings.simplefilter("error") cox.fit(rossi, "week", "arrest", weights_col="weights", robust=True) - assert len(w) == 0 def test_standard_error_coef_output_against_R(self, rossi): """ @@ -5126,9 +5125,9 @@ def test_fitter_will_raise_a_warning_if_instaneous_observation_present(self, ctv df = df.loc[~((df["start"] == df["stop"]) & (df["start"] == 0))] - with pytest.warns(None) as w: + with warnings.catch_warnings(): + warnings.simplefilter("error") ctv.fit(df, id_col="id", start_col="start", stop_col="stop", event_col="event") - assert len(w) == 0 def test_fitter_will_error_if_degenerate_time(self, ctv): df = pd.DataFrame.from_records( diff --git a/lifelines/utils/__init__.py b/lifelines/utils/__init__.py index 8b1b7e451..406cb91ee 100644 --- a/lifelines/utils/__init__.py +++ b/lifelines/utils/__init__.py @@ -250,7 +250,7 @@ def restricted_mean_survival_time( mean = _expected_value_of_survival_up_to_t(model_or_survival_function, t) if return_variance: sq = _expected_value_of_survival_squared_up_to_t(model_or_survival_function, t) - return (mean, sq - mean ** 2) + return (mean, sq - mean**2) else: return mean @@ -993,7 +993,7 @@ def check_dimensions(df): def check_for_numeric_dtypes_or_raise(df): - nonnumeric_cols = [col for (col, dtype) in df.dtypes.iteritems() if dtype.name == "category" or dtype.kind not in "biuf"] + nonnumeric_cols = [col for (col, dtype) in df.dtypes.items() if dtype.name == "category" or dtype.kind not in "biuf"] if len(nonnumeric_cols) > 0: # pylint: disable=len-as-condition raise TypeError( "DataFrame contains nonnumeric columns: %s. Try 1) using pandas.get_dummies to convert the non-numeric column(s) to numerical data, 2) using it in stratification `strata=`, or 3) dropping the column(s)." @@ -1153,7 +1153,7 @@ def check_complete_separation_close_to_perfect_correlation(df: pd.DataFrame, dur durations = durations.sample(n=500, random_state=0) rank_durations = durations.argsort() - for col, series in df.iteritems(): + for col, series in df.items(): with np.errstate(invalid="ignore", divide="ignore"): rank_series = series.values.argsort() if abs(pearson_correlation(rank_durations, rank_series)) >= THRESHOLD: @@ -1583,18 +1583,24 @@ def _to_1d_array(x) -> np.ndarray: return v -def _to_list(x) -> List[Any]: +def _to_list(x: Any) -> List[Any]: if not isinstance(x, list): return [x] return x -def _to_tuple(x) -> Tuple[Any, ...]: +def _to_tuple(x: Any) -> Tuple[Any, ...]: if not isinstance(x, tuple): return (x,) return x +def _to_list_or_singleton(x: List[Any] | Any) -> List[Any] | Any: + if isinstance(x, list) and len(x) == 1: + return x[0] + return x + + def format_p_value(decimals) -> Callable: threshold = 0.5 * 10 ** (-decimals) return lambda p: "<%s" % threshold if p < threshold else "{:4.{prec}f}".format(p, prec=decimals) @@ -1604,7 +1610,7 @@ def format_exp_floats(decimals) -> Callable: """ sometimes the exp. column can be too large """ - threshold = 10 ** 5 + threshold = 10**5 return lambda n: "{:.{prec}e}".format(n, prec=decimals) if n > threshold else "{:4.{prec}f}".format(n, prec=decimals) @@ -1819,7 +1825,7 @@ def find_best_parametric_model( entry=entry, alpha=alpha, ci_labels=ci_labels, - timeline=timeline + timeline=timeline, ) score_ = eval_(model) diff --git a/setup.py b/setup.py index 95cd76309..13ccf6056 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ PACKAGE_DATA = {"lifelines": ["datasets/*"]} DESCRIPTION = "Survival analysis in Python, including Kaplan Meier, Nelson Aalen and regression" URL = "https://github.com/CamDavidsonPilon/lifelines" -PYTHON_REQ = ">=3.7" +PYTHON_REQ = ">=3.7, !=3.11.*" setup( name=NAME, From 16461f4520119cd5f58515e715d9d19776da1fbd Mon Sep 17 00:00:00 2001 From: CamDavidsonPilon Date: Sun, 25 Sep 2022 16:00:27 -0400 Subject: [PATCH 3/5] fix more tests --- lifelines/tests/test_estimation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lifelines/tests/test_estimation.py b/lifelines/tests/test_estimation.py index 6ba9dfda4..8659701e2 100644 --- a/lifelines/tests/test_estimation.py +++ b/lifelines/tests/test_estimation.py @@ -922,6 +922,7 @@ def test_llf_small_values(self, llf): class TestWeibullFitter: + @pytest.mark.skip("skipping due to url read error") def test_unstable_data(self): data = pd.read_csv("https://raw.githubusercontent.com/scotty269/lifelines_test/master/my_data.csv") T = data["T"] From b42ba7ae61538dcf277148d54e9b0d919ec43e0e Mon Sep 17 00:00:00 2001 From: CamDavidsonPilon Date: Sun, 25 Sep 2022 16:02:30 -0400 Subject: [PATCH 4/5] changelog --- CHANGELOG.md | 3 + docs/Changelog.rst | 569 ++++++++++++++++++++++++--------------------- 2 files changed, 306 insertions(+), 266 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7a438a7b..21380cac0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ #### 0.27.3 - Upcoming +##### New features + - Fixed and silenced a lot of warnings + ##### Bug fixes - Migrate to newer Pandas `Styler` for `to_latex` diff --git a/docs/Changelog.rst b/docs/Changelog.rst index 1a488662c..3de60e5b9 100644 --- a/docs/Changelog.rst +++ b/docs/Changelog.rst @@ -1,42 +1,79 @@ Changelog ========= -0.27.1 - 2022-03-15 +0.27.3 - Upcoming +----------------- + +New features +~~~~~~~~~~~~ + +- Fixed and silenced a lot of warnings + +Bug fixes +~~~~~~~~~ + +- Migrate to newer Pandas ``Styler`` for ``to_latex`` + +API Changes +~~~~~~~~~~~ + +- There were way too many functions on the summary objects, so I’ve + hidden ``to_*`` on them. + +0.27.2 - 2022-09-07 +------------------- + +.. _bug-fixes-1: + +Bug fixes +~~~~~~~~~ + +- Fixed issue in add_at_risk_table when there were very late entries. + +.. _section-1: + +0.27.1 - 2022-06-25 ------------------- +.. _new-features-1: + New features ~~~~~~~~~~~~ - all ``fit_`` methods now accept a ``fit_options`` dict that allows one to pass kwargs to the underlying fitting algorithm. +.. _api-changes-1: + API Changes ~~~~~~~~~~~ - ``step_size`` is removed from Cox models ``fit``. See ``fit_options`` above. +.. _bug-fixes-2: + Bug fixes ~~~~~~~~~ -- fixed Cox models when “trival” matrix was passed in (one with no +- fixed Cox models when “trivial” matrix was passed in (one with no covariates) -.. _section-1: +.. _section-2: 0.27.0 - 2022-03-15 ------------------- Dropping Python3.6 support. -.. _bug-fixes-1: +.. _bug-fixes-3: Bug fixes ~~~~~~~~~ - Fix late entry in ``add_at_risk_counts``. -.. _new-features-1: +.. _new-features-2: New features ~~~~~~~~~~~~ @@ -46,7 +83,7 @@ New features - new column in fitter’s ``summary`` that display the number the parameter is being compared against. -.. _api-changes-1: +.. _api-changes-2: API Changes ~~~~~~~~~~~ @@ -56,43 +93,43 @@ API Changes “time observed for”. These interpretations are different when there is late entry. -.. _section-2: +.. _section-3: 0.26.4 - 2021-11-30 ------------------- -.. _new-features-2: +.. _new-features-3: New features ~~~~~~~~~~~~ - adding ``weights`` to log rank functions -.. _section-3: +.. _section-4: 0.26.3 - 2021-09-16 ------------------- -.. _bug-fixes-2: +.. _bug-fixes-4: Bug fixes ~~~~~~~~~ - Fix using formulas with ``CoxPHFitter.score`` -.. _section-4: +.. _section-5: 0.26.2 - 2021-09-15 ------------------- Error in v0.26.1 deployment -.. _section-5: +.. _section-6: 0.26.1 - 2021-09-15 ------------------- -.. _api-changes-2: +.. _api-changes-3: API Changes ~~~~~~~~~~~ @@ -102,7 +139,7 @@ API Changes - update ``status`` column in ``lifelines.datasets.load_lung`` to be more standard coding: 0 is censored, 1 is event. -.. _bug-fixes-3: +.. _bug-fixes-5: Bug fixes ~~~~~~~~~ @@ -111,12 +148,12 @@ Bug fixes ``AalenAdditiveFitter.predict_cumulative_hazard`` - Fix using formulas with ``CoxPHFitter.score`` -.. _section-6: +.. _section-7: 0.26.0 - 2021-05-26 ------------------- -.. _new-features-3: +.. _new-features-4: New features ~~~~~~~~~~~~ @@ -131,7 +168,7 @@ New features summary: the API for estimates doesn’t change depending on what your censoring your dataset is. -.. _bug-fixes-4: +.. _bug-fixes-6: Bug fixes ~~~~~~~~~ @@ -143,12 +180,12 @@ Bug fixes - Fixed regression bug when using an array as a penalizer in Cox models. -.. _section-7: +.. _section-8: 0.25.11 - 2021-04-06 -------------------- -.. _bug-fixes-5: +.. _bug-fixes-7: Bug fixes ~~~~~~~~~ @@ -159,12 +196,12 @@ Bug fixes - Bug fix in the elastic-net penalty for Cox models that wasn’t weighting the terms correctly. -.. _section-8: +.. _section-9: 0.25.10 - 2021-03-03 -------------------- -.. _new-features-4: +.. _new-features-5: New features ~~~~~~~~~~~~ @@ -172,14 +209,14 @@ New features - Better appearance when using a single row to show in ``add_at_risk_table``. -.. _section-9: +.. _section-10: 0.25.9 - 2021-02-04 ------------------- Small bump in dependencies. -.. _section-10: +.. _section-11: 0.25.8 - 2021-01-22 ------------------- @@ -188,7 +225,7 @@ Important: we dropped Patsy as our formula framework, and adopted Formulaic. Will the latter is less mature than Patsy, we feel the core capabilities are satisfactory and it provides new opportunities. -.. _new-features-5: +.. _new-features-6: New features ~~~~~~~~~~~~ @@ -197,19 +234,19 @@ New features - a ``_scipy_callback`` function is available to use in fitting algorithms. -.. _section-11: +.. _section-12: 0.25.7 - 2020-12-09 ------------------- -.. _api-changes-3: +.. _api-changes-4: API Changes ~~~~~~~~~~~ - Adding ``cumulative_hazard_at_times`` to NelsonAalenFitter -.. _bug-fixes-6: +.. _bug-fixes-8: Bug fixes ~~~~~~~~~ @@ -219,12 +256,12 @@ Bug fixes - Fixed ``concordance_index_`` when no events observed - Fixed label being overwritten in ParametricUnivariate models -.. _section-12: +.. _section-13: 0.25.6 - 2020-10-26 ------------------- -.. _new-features-6: +.. _new-features-7: New features ~~~~~~~~~~~~ @@ -232,7 +269,7 @@ New features - Parametric Cox models can now handle left and interval censoring datasets. -.. _bug-fixes-7: +.. _bug-fixes-9: Bug fixes ~~~~~~~~~ @@ -244,12 +281,12 @@ Bug fixes - Fix bug in ``KaplanMeierFitter``\ ’s interval censoring where max(lower bound) < min(upper bound). -.. _section-13: +.. _section-14: 0.25.5 - 2020-09-23 ------------------- -.. _api-changes-4: +.. _api-changes-5: API Changes ~~~~~~~~~~~ @@ -257,7 +294,7 @@ API Changes - ``check_assumptions`` now returns a list of list of axes that can be manipulated -.. _bug-fixes-8: +.. _bug-fixes-10: Bug fixes ~~~~~~~~~ @@ -269,12 +306,12 @@ Bug fixes parametric models - ``weights`` wasn’t being applied properly in NPMLE -.. _section-14: +.. _section-15: 0.25.4 - 2020-08-26 ------------------- -.. _new-features-7: +.. _new-features-8: New features ~~~~~~~~~~~~ @@ -284,19 +321,19 @@ New features ``log_likelihood_ratio_test()`` and ``print_summary()`` - Better step-size defaults for Cox model -> more robust convergence. -.. _bug-fixes-9: +.. _bug-fixes-11: Bug fixes ~~~~~~~~~ - fix ``check_assumptions`` when using formulas. -.. _section-15: +.. _section-16: 0.25.3 - 2020-08-24 ------------------- -.. _new-features-8: +.. _new-features-9: New features ~~~~~~~~~~~~ @@ -305,7 +342,7 @@ New features fitters instead of raw data, meaning that you can use this function on left, right or interval censored data. -.. _api-changes-5: +.. _api-changes-6: API Changes ~~~~~~~~~~~ @@ -313,7 +350,7 @@ API Changes - See note on ``survival_difference_at_fixed_point_in_time_test`` above. -.. _bug-fixes-10: +.. _bug-fixes-12: Bug fixes ~~~~~~~~~ @@ -322,19 +359,19 @@ Bug fixes - fix Python error when calling ``plot_covariate_groups`` - fix dtype mismatches in ``plot_partial_effects_on_outcome``. -.. _section-16: +.. _section-17: 0.25.2 - 2020-08-08 ------------------- -.. _new-features-9: +.. _new-features-10: New features ~~~~~~~~~~~~ - Spline ``CoxPHFitter`` can now use ``strata``. -.. _api-changes-6: +.. _api-changes-7: API Changes ~~~~~~~~~~~ @@ -347,7 +384,7 @@ API Changes the author.). So add 2 to ``n_baseline_knots`` to recover the identical model as previously. -.. _bug-fixes-11: +.. _bug-fixes-13: Bug fixes ~~~~~~~~~ @@ -356,12 +393,12 @@ Bug fixes - fix some exception imports I missed. - fix log-likelihood p-value in splines ``CoxPHFitter`` -.. _section-17: +.. _section-18: 0.25.1 - 2020-08-01 ------------------- -.. _bug-fixes-12: +.. _bug-fixes-14: Bug fixes ~~~~~~~~~ @@ -372,12 +409,12 @@ Bug fixes - put ``patsy`` as a proper dependency. - suppress some Pandas 1.1 warnings. -.. _section-18: +.. _section-19: 0.25.0 - 2020-07-27 ------------------- -.. _new-features-10: +.. _new-features-11: New features ~~~~~~~~~~~~ @@ -395,7 +432,7 @@ New features on the terminal. - ``add_at_risk_counts`` now follows the cool new KMunicate suggestions -.. _api-changes-7: +.. _api-changes-8: API Changes ~~~~~~~~~~~ @@ -434,7 +471,7 @@ API Changes `here `__. - all exceptions and warnings have moved to ``lifelines.exceptions`` -.. _bug-fixes-13: +.. _bug-fixes-15: Bug fixes ~~~~~~~~~ @@ -450,12 +487,12 @@ Bug fixes - fixed NaN bug in ``survival_table_from_events`` with intervals when no events would occur in a interval. -.. _section-19: +.. _section-20: 0.24.16 - 2020-07-09 -------------------- -.. _new-features-11: +.. _new-features-12: New features ~~~~~~~~~~~~ @@ -463,19 +500,19 @@ New features - improved algorithm choice for large DataFrames for Cox models. Should see a significant performance boost. -.. _bug-fixes-14: +.. _bug-fixes-16: Bug fixes ~~~~~~~~~ - fixed ``utils.median_survival_time`` not accepting Pandas Series. -.. _section-20: +.. _section-21: 0.24.15 - 2020-07-07 -------------------- -.. _bug-fixes-15: +.. _bug-fixes-17: Bug fixes ~~~~~~~~~ @@ -486,12 +523,12 @@ Bug fixes - fixed bug where using ``conditional_after`` and ``times`` in ``CoxPHFitter("spline")`` prediction methods would be ignored. -.. _section-21: +.. _section-22: 0.24.14 - 2020-07-02 -------------------- -.. _bug-fixes-16: +.. _bug-fixes-18: Bug fixes ~~~~~~~~~ @@ -503,12 +540,12 @@ Bug fixes - fixed a bug where some columns would not be displayed in ``print_summary`` -.. _section-22: +.. _section-23: 0.24.13 - 2020-06-22 -------------------- -.. _bug-fixes-17: +.. _bug-fixes-19: Bug fixes ~~~~~~~~~ @@ -518,24 +555,24 @@ Bug fixes - fixed a bug where ``CoxPHFitter`` would fail with working with ``sklearn_adapter`` -.. _section-23: +.. _section-24: 0.24.12 - 2020-06-20 -------------------- -.. _new-features-12: +.. _new-features-13: New features ~~~~~~~~~~~~ - improved convergence of ``GeneralizedGamma(Regression)Fitter``. -.. _section-24: +.. _section-25: 0.24.11 - 2020-06-17 -------------------- -.. _new-features-13: +.. _new-features-14: New features ~~~~~~~~~~~~ @@ -549,7 +586,7 @@ New features and the integrated calibration index (ICI) for survival models” by P. Austin, F. Harrell, and D. van Klaveren. -.. _api-changes-8: +.. _api-changes-9: API Changes ~~~~~~~~~~~ @@ -558,12 +595,12 @@ API Changes penalized by ``penalizer`` - we now penalizing everything except intercept terms in linear relationships. -.. _section-25: +.. _section-26: 0.24.10 - 2020-06-16 -------------------- -.. _new-features-14: +.. _new-features-15: New features ~~~~~~~~~~~~ @@ -572,7 +609,7 @@ New features offer much better prediction and baseline-hazard estimation, including extrapolation and interpolation. -.. _api-changes-9: +.. _api-changes-10: API Changes ~~~~~~~~~~~ @@ -580,7 +617,7 @@ API Changes - Related to above: the fitted spline parameters are now available in the ``.summary`` and ``.print_summary`` methods. -.. _bug-fixes-18: +.. _bug-fixes-20: Bug fixes ~~~~~~~~~ @@ -588,12 +625,12 @@ Bug fixes - fixed a bug in initialization of some interval-censoring models -> better convergence. -.. _section-26: +.. _section-27: 0.24.9 - 2020-06-05 ------------------- -.. _new-features-15: +.. _new-features-16: New features ~~~~~~~~~~~~ @@ -603,7 +640,7 @@ New features ``tarone-ware``, ``peto``, ``fleming-harrington``. Thanks @sean-reed - new interval censored dataset: ``lifelines.datasets.load_mice`` -.. _bug-fixes-19: +.. _bug-fixes-21: Bug fixes ~~~~~~~~~ @@ -611,12 +648,12 @@ Bug fixes - Cleared up some mislabeling in ``plot_loglogs``. Thanks @sean-reed! - tuples are now able to be used as input in univariate models. -.. _section-27: +.. _section-28: 0.24.8 - 2020-05-17 ------------------- -.. _new-features-16: +.. _new-features-17: New features ~~~~~~~~~~~~ @@ -625,12 +662,12 @@ New features Not all edge cases are fully checked, and some features are missing. Try it under ``KaplanMeierFitter.fit_interval_censoring`` -.. _section-28: +.. _section-29: 0.24.7 - 2020-05-17 ------------------- -.. _new-features-17: +.. _new-features-18: New features ~~~~~~~~~~~~ @@ -646,12 +683,12 @@ New features - some convergence tweaks which should help recent performance regressions. -.. _section-29: +.. _section-30: 0.24.6 - 2020-05-05 ------------------- -.. _new-features-18: +.. _new-features-19: New features ~~~~~~~~~~~~ @@ -661,7 +698,7 @@ New features - New ``lifelines.plotting.plot_interval_censored_lifetimes`` for plotting interval censored data - thanks @sean-reed! -.. _bug-fixes-20: +.. _bug-fixes-22: Bug fixes ~~~~~~~~~ @@ -669,19 +706,19 @@ Bug fixes - fixed bug where ``cdf_plot`` and ``qq_plot`` were not factoring in the weights correctly. -.. _section-30: +.. _section-31: 0.24.5 - 2020-05-01 ------------------- -.. _new-features-19: +.. _new-features-20: New features ~~~~~~~~~~~~ - ``plot_lifetimes`` accepts pandas Series. -.. _bug-fixes-21: +.. _bug-fixes-23: Bug fixes ~~~~~~~~~ @@ -691,12 +728,12 @@ Bug fixes - Improved ``at_risk_counts`` for subplots. - More data validation checks for ``CoxTimeVaryingFitter`` -.. _section-31: +.. _section-32: 0.24.4 - 2020-04-13 ------------------- -.. _bug-fixes-22: +.. _bug-fixes-24: Bug fixes ~~~~~~~~~ @@ -705,12 +742,12 @@ Bug fixes - setting a dataframe in ``ancillary_df`` works for interval censoring - ``.score`` works for interval censored models -.. _section-32: +.. _section-33: 0.24.3 - 2020-03-25 ------------------- -.. _new-features-20: +.. _new-features-21: New features ~~~~~~~~~~~~ @@ -720,7 +757,7 @@ New features the hazard ratio would be at previous times. This is useful because the final hazard ratio is some weighted average of these. -.. _bug-fixes-23: +.. _bug-fixes-25: Bug fixes ~~~~~~~~~ @@ -728,12 +765,12 @@ Bug fixes - Fixed error in HTML printer that was hiding concordance index information. -.. _section-33: +.. _section-34: 0.24.2 - 2020-03-15 ------------------- -.. _bug-fixes-24: +.. _bug-fixes-26: Bug fixes ~~~~~~~~~ @@ -745,12 +782,12 @@ Bug fixes - Fixed a keyword bug in ``plot_covariate_groups`` for parametric models. -.. _section-34: +.. _section-35: 0.24.1 - 2020-03-05 ------------------- -.. _new-features-21: +.. _new-features-22: New features ~~~~~~~~~~~~ @@ -758,14 +795,14 @@ New features - Stability improvements for GeneralizedGammaRegressionFitter and CoxPHFitter with spline estimation. -.. _bug-fixes-25: +.. _bug-fixes-27: Bug fixes ~~~~~~~~~ - Fixed bug with plotting hazards in NelsonAalenFitter. -.. _section-35: +.. _section-36: 0.24.0 - 2020-02-20 ------------------- @@ -774,7 +811,7 @@ 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. -.. _new-features-22: +.. _new-features-23: New features ~~~~~~~~~~~~ @@ -798,7 +835,7 @@ New features - new ``lifelines.fitters.mixins.ProportionalHazardMixin`` that implements proportional hazard checks. -.. _api-changes-10: +.. _api-changes-11: API Changes ~~~~~~~~~~~ @@ -826,7 +863,7 @@ API Changes to ``scoring_method``. - removed ``_score_`` and ``path`` from Cox model. -.. _bug-fixes-26: +.. _bug-fixes-28: Bug fixes ~~~~~~~~~ @@ -839,12 +876,12 @@ Bug fixes - Cox models now incorporate any penalizers in their ``log_likelihood_`` -.. _section-36: +.. _section-37: 0.23.9 - 2020-01-28 ------------------- -.. _bug-fixes-27: +.. _bug-fixes-29: Bug fixes ~~~~~~~~~ @@ -855,12 +892,12 @@ Bug fixes of ``GeneralizedGammaRegressionFitter`` and any custom regression models should update their code as soon as possible. -.. _section-37: +.. _section-38: 0.23.8 - 2020-01-21 ------------------- -.. _bug-fixes-28: +.. _bug-fixes-30: Bug fixes ~~~~~~~~~ @@ -871,19 +908,19 @@ Bug fixes ``GeneralizedGammaRegressionFitter`` and any custom regression models should update their code as soon as possible. -.. _section-38: +.. _section-39: 0.23.7 - 2020-01-14 ------------------- Bug fixes for py3.5. -.. _section-39: +.. _section-40: 0.23.6 - 2020-01-07 ------------------- -.. _new-features-23: +.. _new-features-24: New features ~~~~~~~~~~~~ @@ -897,12 +934,12 @@ New features - custom parametric regression models can now do left and interval censoring. -.. _section-40: +.. _section-41: 0.23.5 - 2020-01-05 ------------------- -.. _new-features-24: +.. _new-features-25: New features ~~~~~~~~~~~~ @@ -911,7 +948,7 @@ New features - New lymph node cancer dataset, originally from *H.F. for the German Breast Cancer Study Group (GBSG) (1994)* -.. _bug-fixes-29: +.. _bug-fixes-31: Bug fixes ~~~~~~~~~ @@ -921,26 +958,26 @@ Bug fixes - fixed bug where large exponential numbers in ``print_summary`` were not being suppressed correctly. -.. _section-41: +.. _section-42: 0.23.4 - 2019-12-15 ------------------- - Bug fix for PyPI -.. _section-42: +.. _section-43: 0.23.3 - 2019-12-11 ------------------- -.. _new-features-25: +.. _new-features-26: New features ~~~~~~~~~~~~ - ``StatisticalResult.print_summary`` supports html output. -.. _bug-fixes-30: +.. _bug-fixes-32: Bug fixes ~~~~~~~~~ @@ -948,12 +985,12 @@ Bug fixes - fix import in ``printer.py`` - fix html printing with Univariate models. -.. _section-43: +.. _section-44: 0.23.2 - 2019-12-07 ------------------- -.. _new-features-26: +.. _new-features-27: New features ~~~~~~~~~~~~ @@ -965,7 +1002,7 @@ New features - performance improvements on regression models’ preprocessing. Should make datasets with high number of columns more performant. -.. _bug-fixes-31: +.. _bug-fixes-33: Bug fixes ~~~~~~~~~ @@ -974,12 +1011,12 @@ Bug fixes - fixed repr for ``sklearn_adapter`` classes. - fixed ``conditional_after`` in Cox model with strata was used. -.. _section-44: +.. _section-45: 0.23.1 - 2019-11-27 ------------------- -.. _new-features-27: +.. _new-features-28: New features ~~~~~~~~~~~~ @@ -989,7 +1026,7 @@ New features - performance improvements for ``CoxPHFitter`` - up to 30% performance improvements for some datasets. -.. _bug-fixes-32: +.. _bug-fixes-34: Bug fixes ~~~~~~~~~ @@ -1001,12 +1038,12 @@ Bug fixes - fixed bug when using ``print_summary`` with left censored models. - lots of minor bug fixes. -.. _section-45: +.. _section-46: 0.23.0 - 2019-11-17 ------------------- -.. _new-features-28: +.. _new-features-29: New features ~~~~~~~~~~~~ @@ -1015,7 +1052,7 @@ New features Jupyter notebooks! - silenced some warnings. -.. _bug-fixes-33: +.. _bug-fixes-35: Bug fixes ~~~~~~~~~ @@ -1025,7 +1062,7 @@ Bug fixes now fixed. - fixed a NaN error in confidence intervals for KaplanMeierFitter -.. _api-changes-11: +.. _api-changes-12: API Changes ~~~~~~~~~~~ @@ -1037,7 +1074,7 @@ API Changes - ``left_censorship`` in ``fit`` has been removed in favour of ``fit_left_censoring``. -.. _section-46: +.. _section-47: 0.22.10 - 2019-11-08 -------------------- @@ -1045,7 +1082,7 @@ API Changes The tests were re-factored to be shipped with the package. Let me know if this causes problems. -.. _bug-fixes-34: +.. _bug-fixes-36: Bug fixes ~~~~~~~~~ @@ -1055,12 +1092,12 @@ Bug fixes - fixed bug in plot_covariate_groups for AFT models when >1d arrays were used for values arg. -.. _section-47: +.. _section-48: 0.22.9 - 2019-10-30 ------------------- -.. _bug-fixes-35: +.. _bug-fixes-37: Bug fixes ~~~~~~~~~ @@ -1072,12 +1109,12 @@ Bug fixes - ``CoxPHFitter`` now displays correct columns values when changing alpha param. -.. _section-48: +.. _section-49: 0.22.8 - 2019-10-06 ------------------- -.. _new-features-29: +.. _new-features-30: New features ~~~~~~~~~~~~ @@ -1087,19 +1124,19 @@ New features - ``conditional_after`` now available in ``CoxPHFitter.predict_median`` - Suppressed some unimportant warnings. -.. _bug-fixes-36: +.. _bug-fixes-38: Bug fixes ~~~~~~~~~ - fixed initial_point being ignored in AFT models. -.. _section-49: +.. _section-50: 0.22.7 - 2019-09-29 ------------------- -.. _new-features-30: +.. _new-features-31: New features ~~~~~~~~~~~~ @@ -1107,7 +1144,7 @@ New features - new ``ApproximationWarning`` to tell you if the package is making an potentially mislead approximation. -.. _bug-fixes-37: +.. _bug-fixes-39: Bug fixes ~~~~~~~~~ @@ -1116,7 +1153,7 @@ Bug fixes - realigned values in ``print_summary``. - fixed bug in ``survival_difference_at_fixed_point_in_time_test`` -.. _api-changes-12: +.. _api-changes-13: API Changes ~~~~~~~~~~~ @@ -1126,24 +1163,24 @@ API Changes - Some previous ``StatisticalWarnings`` have been replaced by ``ApproximationWarning`` -.. _section-50: +.. _section-51: 0.22.6 - 2019-09-25 ------------------- -.. _new-features-31: +.. _new-features-32: New features ~~~~~~~~~~~~ - ``conditional_after`` works for ``CoxPHFitter`` prediction models 😅 -.. _bug-fixes-38: +.. _bug-fixes-40: Bug fixes ~~~~~~~~~ -.. _api-changes-13: +.. _api-changes-14: API Changes ~~~~~~~~~~~ @@ -1154,12 +1191,12 @@ API Changes - ``utils.dataframe_interpolate_at_times`` renamed to ``utils.interpolate_at_times_and_return_pandas``. -.. _section-51: +.. _section-52: 0.22.5 - 2019-09-20 ------------------- -.. _new-features-32: +.. _new-features-33: New features ~~~~~~~~~~~~ @@ -1168,7 +1205,7 @@ New features weights. - Better support for predicting on Pandas Series -.. _bug-fixes-39: +.. _bug-fixes-41: Bug fixes ~~~~~~~~~ @@ -1177,7 +1214,7 @@ Bug fixes - Fixed an issue with ``AalenJohansenFitter`` failing to plot confidence intervals. -.. _api-changes-14: +.. _api-changes-15: API Changes ~~~~~~~~~~~ @@ -1185,12 +1222,12 @@ API Changes - ``_get_initial_value`` in parametric univariate models is renamed ``_create_initial_point`` -.. _section-52: +.. _section-53: 0.22.4 - 2019-09-04 ------------------- -.. _new-features-33: +.. _new-features-34: New features ~~~~~~~~~~~~ @@ -1201,7 +1238,7 @@ New features - new ``utils.restricted_mean_survival_time`` that approximates the RMST using numerical integration against survival functions. -.. _api-changes-15: +.. _api-changes-16: API changes ~~~~~~~~~~~ @@ -1209,7 +1246,7 @@ API changes - ``KaplanMeierFitter.survival_function_``\ ‘s’ index is no longer given the name “timeline”. -.. _bug-fixes-40: +.. _bug-fixes-42: Bug fixes ~~~~~~~~~ @@ -1217,12 +1254,12 @@ Bug fixes - Fixed issue where ``concordance_index`` would never exit if NaNs in dataset. -.. _section-53: +.. _section-54: 0.22.3 - 2019-08-08 ------------------- -.. _new-features-34: +.. _new-features-35: New features ~~~~~~~~~~~~ @@ -1235,7 +1272,7 @@ New features - smarter initial conditions for parametric regression models. - New regression model: ``GeneralizedGammaRegressionFitter`` -.. _api-changes-16: +.. _api-changes-17: API changes ~~~~~~~~~~~ @@ -1246,7 +1283,7 @@ API changes gains only in Cox models, and only a small fraction of the API was being used. -.. _bug-fixes-41: +.. _bug-fixes-43: Bug fixes ~~~~~~~~~ @@ -1258,19 +1295,19 @@ Bug fixes - Fixed an error in the ``predict_percentile`` of ``LogLogisticAFTFitter``. New tests have been added around this. -.. _section-54: +.. _section-55: 0.22.2 - 2019-07-25 ------------------- -.. _new-features-35: +.. _new-features-36: New features ~~~~~~~~~~~~ - lifelines is now compatible with scipy>=1.3.0 -.. _bug-fixes-42: +.. _bug-fixes-44: Bug fixes ~~~~~~~~~ @@ -1281,12 +1318,12 @@ Bug fixes errors when using the library. The correctly numpy has been pinned (to 1.14.0+) -.. _section-55: +.. _section-56: 0.22.1 - 2019-07-14 ------------------- -.. _new-features-36: +.. _new-features-37: New features ~~~~~~~~~~~~ @@ -1301,7 +1338,7 @@ New features right censoring) - improvements to ``lifelines.utils.gamma`` -.. _api-changes-17: +.. _api-changes-18: API changes ~~~~~~~~~~~ @@ -1314,7 +1351,7 @@ API changes ``.print_summary`` includes confidence intervals for the exponential of the value. -.. _bug-fixes-43: +.. _bug-fixes-45: Bug fixes ~~~~~~~~~ @@ -1324,12 +1361,12 @@ Bug fixes - fixed an overflow bug in ``KaplanMeierFitter`` confidence intervals - improvements in data validation for ``CoxTimeVaryingFitter`` -.. _section-56: +.. _section-57: 0.22.0 - 2019-07-03 ------------------- -.. _new-features-37: +.. _new-features-38: New features ~~~~~~~~~~~~ @@ -1341,7 +1378,7 @@ New features - for parametric univariate models, the ``conditional_time_to_event_`` is now exact instead of an approximation. -.. _api-changes-18: +.. _api-changes-19: API changes ~~~~~~~~~~~ @@ -1363,7 +1400,7 @@ API changes could set ``fit_intercept`` to False and not have to set ``ancillary_df`` - now one must specify a DataFrame. -.. _bug-fixes-44: +.. _bug-fixes-46: Bug fixes ~~~~~~~~~ @@ -1372,21 +1409,21 @@ Bug fixes is now exact instead of an approximation. - fixed a name error bug in ``CoxTimeVaryingFitter.plot`` -.. _section-57: +.. _section-58: 0.21.5 - 2019-06-22 ------------------- I’m skipping 0.21.4 version because of deployment issues. -.. _new-features-38: +.. _new-features-39: New features ~~~~~~~~~~~~ - ``scoring_method`` now a kwarg on ``sklearn_adapter`` -.. _bug-fixes-45: +.. _bug-fixes-47: Bug fixes ~~~~~~~~~ @@ -1396,12 +1433,12 @@ Bug fixes - fixed visual bug that misaligned x-axis ticks and at-risk counts. Thanks @christopherahern! -.. _section-58: +.. _section-59: 0.21.3 - 2019-06-04 ------------------- -.. _new-features-39: +.. _new-features-40: New features ~~~~~~~~~~~~ @@ -1415,19 +1452,19 @@ New features - ``CoxPHFitter.check_assumptions`` now accepts a ``columns`` parameter to specify only checking a subset of columns. -.. _bug-fixes-46: +.. _bug-fixes-48: Bug fixes ~~~~~~~~~ - ``covariates_from_event_matrix`` handle nulls better -.. _section-59: +.. _section-60: 0.21.2 - 2019-05-16 ------------------- -.. _new-features-40: +.. _new-features-41: New features ~~~~~~~~~~~~ @@ -1439,7 +1476,7 @@ New features that computes, you guessed it, the log-likelihood ratio test. Previously this was an internal API that is being exposed. -.. _api-changes-19: +.. _api-changes-20: API changes ~~~~~~~~~~~ @@ -1451,17 +1488,17 @@ API changes - removing ``_compute_likelihood_ratio_test`` on regression models. Use ``log_likelihood_ratio_test`` now. -.. _bug-fixes-47: +.. _bug-fixes-49: Bug fixes ~~~~~~~~~ -.. _section-60: +.. _section-61: 0.21.1 - 2019-04-26 ------------------- -.. _new-features-41: +.. _new-features-42: New features ~~~~~~~~~~~~ @@ -1470,7 +1507,7 @@ New features ``add_covariate_to_timeline`` - PiecewiseExponentialFitter now allows numpy arrays as breakpoints -.. _api-changes-20: +.. _api-changes-21: API changes ~~~~~~~~~~~ @@ -1478,19 +1515,19 @@ API changes - output of ``survival_table_from_events`` when collapsing rows to intervals now removes the “aggregate” column multi-index. -.. _bug-fixes-48: +.. _bug-fixes-50: Bug fixes ~~~~~~~~~ - fixed bug in CoxTimeVaryingFitter when ax is provided, thanks @j-i-l! -.. _section-61: +.. _section-62: 0.21.0 - 2019-04-12 ------------------- -.. _new-features-42: +.. _new-features-43: New features ~~~~~~~~~~~~ @@ -1504,7 +1541,7 @@ New features - a new interval censored dataset is available under ``lifelines.datasets.load_diabetes`` -.. _api-changes-21: +.. _api-changes-22: API changes ~~~~~~~~~~~ @@ -1515,7 +1552,7 @@ API changes - ``entries`` property in multivariate parametric models has a new Series name: ``entry`` -.. _bug-fixes-49: +.. _bug-fixes-51: Bug fixes ~~~~~~~~~ @@ -1525,19 +1562,19 @@ Bug fixes - Fixed an error that didn’t let users use Numpy arrays in prediction for AFT models -.. _section-62: +.. _section-63: 0.20.5 - 2019-04-08 ------------------- -.. _new-features-43: +.. _new-features-44: New features ~~~~~~~~~~~~ - performance improvements for ``print_summary``. -.. _api-changes-22: +.. _api-changes-23: API changes ~~~~~~~~~~~ @@ -1547,7 +1584,7 @@ API changes - in ``AalenJohansenFitter``, the ``variance`` parameter is renamed to ``variance_`` to align with the usual lifelines convention. -.. _bug-fixes-50: +.. _bug-fixes-52: Bug fixes ~~~~~~~~~ @@ -1556,12 +1593,12 @@ Bug fixes test when using strata. - Fixed some plotting bugs with ``AalenJohansenFitter`` -.. _section-63: +.. _section-64: 0.20.4 - 2019-03-27 ------------------- -.. _new-features-44: +.. _new-features-45: New features ~~~~~~~~~~~~ @@ -1572,7 +1609,7 @@ New features generating piecewise exp. data - Faster ``print_summary`` for AFT models. -.. _api-changes-23: +.. _api-changes-24: API changes ~~~~~~~~~~~ @@ -1580,7 +1617,7 @@ API changes - Pandas is now correctly pinned to >= 0.23.0. This was always the case, but not specified in setup.py correctly. -.. _bug-fixes-51: +.. _bug-fixes-53: Bug fixes ~~~~~~~~~ @@ -1589,12 +1626,12 @@ Bug fixes - ``PiecewiseExponentialFitter`` is available with ``from lifelines import *``. -.. _section-64: +.. _section-65: 0.20.3 - 2019-03-23 ------------------- -.. _new-features-45: +.. _new-features-46: New features ~~~~~~~~~~~~ @@ -1607,12 +1644,12 @@ New features ``plot_survival_function`` and ``confidence_interval_survival_function_``. -.. _section-65: +.. _section-66: 0.20.2 - 2019-03-21 ------------------- -.. _new-features-46: +.. _new-features-47: New features ~~~~~~~~~~~~ @@ -1627,7 +1664,7 @@ New features - add a ``lifelines.plotting.qq_plot`` for univariate parametric models that handles censored data. -.. _api-changes-24: +.. _api-changes-25: API changes ~~~~~~~~~~~ @@ -1636,7 +1673,7 @@ API changes @vpolimenov! - The ``C`` column in ``load_lcd`` dataset is renamed to ``E``. -.. _bug-fixes-52: +.. _bug-fixes-54: Bug fixes ~~~~~~~~~ @@ -1652,7 +1689,7 @@ Bug fixes the q parameter was below the truncation limit. This should have been ``-np.inf`` -.. _section-66: +.. _section-67: 0.20.1 - 2019-03-16 ------------------- @@ -1666,7 +1703,7 @@ Bug fixes decades of development. - suppressed unimportant warnings -.. _api-changes-25: +.. _api-changes-26: API changes ~~~~~~~~~~~ @@ -1676,7 +1713,7 @@ API changes This is no longer the case. A 0 will still be added if there is a duration (observed or not) at 0 occurs however. -.. _section-67: +.. _section-68: 0.20.0 - 2019-03-05 ------------------- @@ -1685,7 +1722,7 @@ API changes recent installs where Py3. - Updated minimum dependencies, specifically Matplotlib and Pandas. -.. _new-features-47: +.. _new-features-48: New features ~~~~~~~~~~~~ @@ -1693,7 +1730,7 @@ New features - smarter initialization for AFT models which should improve convergence. -.. _api-changes-26: +.. _api-changes-27: API changes ~~~~~~~~~~~ @@ -1705,19 +1742,19 @@ API changes transposed now (previous parameters where columns, now parameters are rows). -.. _bug-fixes-53: +.. _bug-fixes-55: Bug fixes ~~~~~~~~~ - Fixed a bug with plotting and ``check_assumptions``. -.. _section-68: +.. _section-69: 0.19.5 - 2019-02-26 ------------------- -.. _new-features-48: +.. _new-features-49: New features ~~~~~~~~~~~~ @@ -1727,24 +1764,24 @@ New features features or categorical variables. - Convergence improvements for AFT models. -.. _section-69: +.. _section-70: 0.19.4 - 2019-02-25 ------------------- -.. _bug-fixes-54: +.. _bug-fixes-56: Bug fixes ~~~~~~~~~ - remove some bad print statements in ``CoxPHFitter``. -.. _section-70: +.. _section-71: 0.19.3 - 2019-02-25 ------------------- -.. _new-features-49: +.. _new-features-50: New features ~~~~~~~~~~~~ @@ -1756,12 +1793,12 @@ New features - Performance increase to ``print_summary`` in the ``CoxPHFitter`` and ``CoxTimeVaryingFitter`` model. -.. _section-71: +.. _section-72: 0.19.2 - 2019-02-22 ------------------- -.. _new-features-50: +.. _new-features-51: New features ~~~~~~~~~~~~ @@ -1769,7 +1806,7 @@ New features - ``ParametricUnivariateFitters``, like ``WeibullFitter``, have smoothed plots when plotting (vs stepped plots) -.. _bug-fixes-55: +.. _bug-fixes-57: Bug fixes ~~~~~~~~~ @@ -1779,12 +1816,12 @@ Bug fixes - Univariate fitters are more flexiable and can allow 2-d and DataFrames as inputs. -.. _section-72: +.. _section-73: 0.19.1 - 2019-02-21 ------------------- -.. _new-features-51: +.. _new-features-52: New features ~~~~~~~~~~~~ @@ -1792,7 +1829,7 @@ New features - improved stability of ``LogNormalFitter`` - Matplotlib for Python3 users are not longer forced to use 2.x. -.. _api-changes-27: +.. _api-changes-28: API changes ~~~~~~~~~~~ @@ -1801,12 +1838,12 @@ API changes ``PiecewiseExponential`` to the same as ``ExponentialFitter`` (from ``\lambda * t`` to ``t / \lambda``). -.. _section-73: +.. _section-74: 0.19.0 - 2019-02-20 ------------------- -.. _new-features-52: +.. _new-features-53: New features ~~~~~~~~~~~~ @@ -1819,7 +1856,7 @@ New features - ``CoxPHFitter`` performance improvements (about 10%) - ``CoxTimeVaryingFitter`` performance improvements (about 10%) -.. _api-changes-28: +.. _api-changes-29: API changes ~~~~~~~~~~~ @@ -1845,7 +1882,7 @@ API changes means that the *default* for alpha is set to 0.05 in the latest lifelines, instead of 0.95 in previous versions. -.. _bug-fixes-56: +.. _bug-fixes-58: Bug Fixes ~~~~~~~~~ @@ -1862,7 +1899,7 @@ Bug Fixes models. Thanks @airanmehr! - Fixed some Pandas <0.24 bugs. -.. _section-74: +.. _section-75: 0.18.6 - 2019-02-13 ------------------- @@ -1872,7 +1909,7 @@ Bug Fixes ``rank`` and ``km`` p-values now. - some performance improvements to ``qth_survival_time``. -.. _section-75: +.. _section-76: 0.18.5 - 2019-02-11 ------------------- @@ -1893,7 +1930,7 @@ Bug Fixes that can be used to turn off variance calculations since this can take a long time for large datasets. Thanks @pzivich! -.. _section-76: +.. _section-77: 0.18.4 - 2019-02-10 ------------------- @@ -1903,7 +1940,7 @@ Bug Fixes - adding left-truncation support to parametric univarite models with the ``entry`` kwarg in ``.fit`` -.. _section-77: +.. _section-78: 0.18.3 - 2019-02-07 ------------------- @@ -1913,7 +1950,7 @@ Bug Fixes warnings are more noticeable. - Improved some warning and error messages. -.. _section-78: +.. _section-79: 0.18.2 - 2019-02-05 ------------------- @@ -1929,7 +1966,7 @@ Bug Fixes Moved them all (most) to use ``autograd``. - ``LogNormalFitter`` no longer models ``log_sigma``. -.. _section-79: +.. _section-80: 0.18.1 - 2019-02-02 ------------------- @@ -1940,7 +1977,7 @@ Bug Fixes - use the ``autograd`` lib to help with gradients. - New ``LogLogisticFitter`` univariate fitter available. -.. _section-80: +.. _section-81: 0.18.0 - 2019-01-31 ------------------- @@ -1977,7 +2014,7 @@ Bug Fixes ``LinAlgError: Matrix is singular.`` and report back to the user advice. -.. _section-81: +.. _section-82: 0.17.5 - 2019-01-25 ------------------- @@ -1985,7 +2022,7 @@ Bug Fixes - more bugs in ``plot_covariate_groups`` fixed when using non-numeric strata. -.. _section-82: +.. _section-83: 0.17.4 -2019-01-25 ------------------ @@ -1997,7 +2034,7 @@ Bug Fixes - ``groups`` is now called ``values`` in ``CoxPHFitter.plot_covariate_groups`` -.. _section-83: +.. _section-84: 0.17.3 - 2019-01-24 ------------------- @@ -2005,7 +2042,7 @@ Bug Fixes - Fix in ``compute_residuals`` when using ``schoenfeld`` and the minumum duration has only censored subjects. -.. _section-84: +.. _section-85: 0.17.2 2019-01-22 ----------------- @@ -2016,7 +2053,7 @@ Bug Fixes ``for`` loop. The downside is the code is more esoteric now. I’ve added comments as necessary though 🤞 -.. _section-85: +.. _section-86: 0.17.1 - 2019-01-20 ------------------- @@ -2033,7 +2070,7 @@ Bug Fixes - Fixes a Pandas performance warning in ``CoxTimeVaryingFitter``. - Performances improvements to ``CoxTimeVaryingFitter``. -.. _section-86: +.. _section-87: 0.17.0 - 2019-01-11 ------------------- @@ -2054,7 +2091,7 @@ Bug Fixes - some plotting improvemnts to ``plotting.plot_lifetimes`` -.. _section-87: +.. _section-88: 0.16.3 - 2019-01-03 ------------------- @@ -2062,7 +2099,7 @@ Bug Fixes - More ``CoxPHFitter`` performance improvements. Up to a 40% reduction vs 0.16.2 for some datasets. -.. _section-88: +.. _section-89: 0.16.2 - 2019-01-02 ------------------- @@ -2073,14 +2110,14 @@ Bug Fixes has lots of duplicate times. See https://github.com/CamDavidsonPilon/lifelines/issues/591 -.. _section-89: +.. _section-90: 0.16.1 - 2019-01-01 ------------------- - Fixed py2 division error in ``concordance`` method. -.. _section-90: +.. _section-91: 0.16.0 - 2019-01-01 ------------------- @@ -2116,7 +2153,7 @@ Bug Fixes ``lifelines.utils.to_episodic_format``. - ``CoxTimeVaryingFitter`` now accepts ``strata``. -.. _section-91: +.. _section-92: 0.15.4 ------ @@ -2124,14 +2161,14 @@ Bug Fixes - bug fix for the Cox model likelihood ratio test when using non-trivial weights. -.. _section-92: +.. _section-93: 0.15.3 - 2018-12-18 ------------------- - Only allow matplotlib less than 3.0. -.. _section-93: +.. _section-94: 0.15.2 - 2018-11-23 ------------------- @@ -2142,7 +2179,7 @@ Bug Fixes - removed ``entry`` from ``ExponentialFitter`` and ``WeibullFitter`` as it was doing nothing. -.. _section-94: +.. _section-95: 0.15.1 - 2018-11-23 ------------------- @@ -2151,7 +2188,7 @@ Bug Fixes - Raise NotImplementedError if the ``robust`` flag is used in ``CoxTimeVaryingFitter`` - that’s not ready yet. -.. _section-95: +.. _section-96: 0.15.0 - 2018-11-22 ------------------- @@ -2222,7 +2259,7 @@ Bug Fixes When Estimating Risks in Pharmacoepidemiology” for a nice overview of the model. -.. _section-96: +.. _section-97: 0.14.6 - 2018-07-02 ------------------- @@ -2230,7 +2267,7 @@ Bug Fixes - fix for n > 2 groups in ``multivariate_logrank_test`` (again). - fix bug for when ``event_observed`` column was not boolean. -.. _section-97: +.. _section-98: 0.14.5 - 2018-06-29 ------------------- @@ -2238,7 +2275,7 @@ Bug Fixes - fix for n > 2 groups in ``multivariate_logrank_test`` - fix weights in KaplanMeierFitter when using a pandas Series. -.. _section-98: +.. _section-99: 0.14.4 - 2018-06-14 ------------------- @@ -2255,7 +2292,7 @@ Bug Fixes - New ``delay`` parameter in ``add_covariate_to_timeline`` - removed ``two_sided_z_test`` from ``statistics`` -.. _section-99: +.. _section-100: 0.14.3 - 2018-05-24 ------------------- @@ -2267,7 +2304,7 @@ Bug Fixes - adds a ``column`` argument to ``CoxTimeVaryingFitter`` and ``CoxPHFitter`` ``plot`` method to plot only a subset of columns. -.. _section-100: +.. _section-101: 0.14.2 - 2018-05-18 ------------------- @@ -2275,7 +2312,7 @@ Bug Fixes - some quality of life improvements for working with ``CoxTimeVaryingFitter`` including new ``predict_`` methods. -.. _section-101: +.. _section-102: 0.14.1 - 2018-04-01 ------------------- @@ -2293,7 +2330,7 @@ Bug Fixes faster completion of ``fit`` for large dataframes, and up to 10% faster for small dataframes. -.. _section-102: +.. _section-103: 0.14.0 - 2018-03-03 ------------------- @@ -2315,7 +2352,7 @@ Bug Fixes of a ``RuntimeWarning`` - New checks for complete separation in the dataset for regressions. -.. _section-103: +.. _section-104: 0.13.0 - 2017-12-22 ------------------- @@ -2344,7 +2381,7 @@ Bug Fixes group the same subjects together and give that observation a weight equal to the count. Altogether, this means a much faster regression. -.. _section-104: +.. _section-105: 0.12.0 ------ @@ -2361,7 +2398,7 @@ Bug Fixes - Additional functionality to ``utils.survival_table_from_events`` to bin the index to make the resulting table more readable. -.. _section-105: +.. _section-106: 0.11.3 ------ @@ -2373,7 +2410,7 @@ Bug Fixes observation or censorship. - More accurate prediction methods parametrics univariate models. -.. _section-106: +.. _section-107: 0.11.2 ------ @@ -2381,14 +2418,14 @@ Bug Fixes - Changing liscense to valilla MIT. - Speed up ``NelsonAalenFitter.fit`` considerably. -.. _section-107: +.. _section-108: 0.11.1 - 2017-06-22 ------------------- - Python3 fix for ``CoxPHFitter.plot``. -.. _section-108: +.. _section-109: 0.11.0 - 2017-06-21 ------------------- @@ -2402,14 +2439,14 @@ Bug Fixes of a new ``loc`` kwarg. This is to align with Pandas deprecating ``ix`` -.. _section-109: +.. _section-110: 0.10.1 - 2017-06-05 ------------------- - fix in internal normalization for ``CoxPHFitter`` predict methods. -.. _section-110: +.. _section-111: 0.10.0 ------ @@ -2424,7 +2461,7 @@ Bug Fixes mimic R’s ``basehaz`` API. - new ``predict_log_partial_hazards`` to ``CoxPHFitter`` -.. _section-111: +.. _section-112: 0.9.4 ----- @@ -2447,7 +2484,7 @@ Bug Fixes - performance improvements in ``CoxPHFitter`` - should see at least a 10% speed improvement in ``fit``. -.. _section-112: +.. _section-113: 0.9.2 ----- @@ -2456,7 +2493,7 @@ Bug Fixes - throw an error if no admissable pairs in the c-index calculation. Previously a NaN was returned. -.. _section-113: +.. _section-114: 0.9.1 ----- @@ -2464,7 +2501,7 @@ Bug Fixes - add two summary functions to Weibull and Exponential fitter, solves #224 -.. _section-114: +.. _section-115: 0.9.0 ----- @@ -2480,7 +2517,7 @@ Bug Fixes - Default predict method in ``k_fold_cross_validation`` is now ``predict_expectation`` -.. _section-115: +.. _section-116: 0.8.1 - 2015-08-01 ------------------ @@ -2497,7 +2534,7 @@ Bug Fixes - scaling of smooth hazards in NelsonAalenFitter was off by a factor of 0.5. -.. _section-116: +.. _section-117: 0.8.0 ----- @@ -2516,7 +2553,7 @@ Bug Fixes ``lifelines.statistics. power_under_cph``. - fixed a bug when using KaplanMeierFitter for left-censored data. -.. _section-117: +.. _section-118: 0.7.1 ----- @@ -2535,7 +2572,7 @@ Bug Fixes - refactor each fitter into it’s own submodule. For now, the tests are still in the same file. This will also *not* break the API. -.. _section-118: +.. _section-119: 0.7.0 - 2015-03-01 ------------------ @@ -2554,7 +2591,7 @@ Bug Fixes duration remaining until the death event, given survival up until time t. -.. _section-119: +.. _section-120: 0.6.1 ----- @@ -2566,7 +2603,7 @@ Bug Fixes your work is to sum up the survival function (for expected values or something similar), it’s more difficult to make a mistake. -.. _section-120: +.. _section-121: 0.6.0 - 2015-02-04 ------------------ @@ -2589,7 +2626,7 @@ Bug Fixes - In ``KaplanMeierFitter``, ``epsilon`` has been renamed to ``precision``. -.. _section-121: +.. _section-122: 0.5.1 - 2014-12-24 ------------------ @@ -2610,7 +2647,7 @@ Bug Fixes ``lifelines.plotting.add_at_risk_counts``. - Fix bug Epanechnikov kernel. -.. _section-122: +.. _section-123: 0.5.0 - 2014-12-07 ------------------ @@ -2623,7 +2660,7 @@ Bug Fixes - add test for summary() - Alternate metrics can be used for ``k_fold_cross_validation``. -.. _section-123: +.. _section-124: 0.4.4 - 2014-11-27 ------------------ @@ -2635,7 +2672,7 @@ Bug Fixes - Fixes bug in 1-d input not returning in CoxPHFitter - Lots of new tests. -.. _section-124: +.. _section-125: 0.4.3 - 2014-07-23 ------------------ @@ -2656,7 +2693,7 @@ Bug Fixes - Adds option ``include_likelihood`` to CoxPHFitter fit method to save the final log-likelihood value. -.. _section-125: +.. _section-126: 0.4.2 - 2014-06-19 ------------------ @@ -2676,7 +2713,7 @@ Bug Fixes from failing so often (this a stop-gap) - pep8 everything -.. _section-126: +.. _section-127: 0.4.1.1 ------- @@ -2689,7 +2726,7 @@ Bug Fixes - Adding more robust cross validation scheme based on issue #67. - fixing ``regression_dataset`` in ``datasets``. -.. _section-127: +.. _section-128: 0.4.1 - 2014-06-11 ------------------ @@ -2708,7 +2745,7 @@ Bug Fixes - Adding a Changelog. - more sanitizing for the statistical tests =) -.. _section-128: +.. _section-129: 0.4.0 - 2014-06-08 ------------------ From 3dee468293409956eb0897a401e9fac758b4099b Mon Sep 17 00:00:00 2001 From: CamDavidsonPilon Date: Sun, 25 Sep 2022 18:11:57 -0400 Subject: [PATCH 5/5] Jinja2 need for tests and printing latex --- reqs/dev-requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/reqs/dev-requirements.txt b/reqs/dev-requirements.txt index 4eb962ce6..490e5c8a1 100644 --- a/reqs/dev-requirements.txt +++ b/reqs/dev-requirements.txt @@ -16,6 +16,7 @@ dill statsmodels flaky scikit-learn>=0.22.0 +Jinja2 # ex: `py.test` in the docs/ folder. See conftest.py in docs/ first sybil