Skip to content

Commit 4dd68d8

Browse files
fix test
1 parent 0d10c9e commit 4dd68d8

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

lifelines/fitters/log_normal_fitter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _create_initial_point(self, Ts, E, *args):
6565
elif CensoringType.is_left_censoring(self):
6666
log_T = np.log(Ts[1])
6767
elif CensoringType.is_interval_censoring(self):
68-
log_T = np.log(Ts[1] - Ts[0])
68+
log_T = np.log(Ts[1])
6969
return np.array([np.median(log_T), 1.0])
7070

7171
@property

tests/test_estimation.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,16 +2486,6 @@ def test_martingale_residuals(self, regression_dataset, cph):
24862486
npt.assert_allclose(results.loc[1, "martingale"], 0.774216356429, rtol=1e-05)
24872487
npt.assert_allclose(results.loc[199, "martingale"], 0.868510420157, rtol=1e-05)
24882488

2489-
def test_error_is_raised_if_using_non_numeric_data_in_prediction(self, cph):
2490-
df = pd.DataFrame({"t": [1.0, 2.0, 3.0, 4.0], "int_": [1, -1, 0, 0], "float_": [1.2, -0.5, 0.0, 0.1]})
2491-
2492-
cph.fit(df, duration_col="t")
2493-
2494-
df_predict_on = pd.DataFrame({"int_": ["1", "-1", "0"], "float_": [1.2, -0.5, 0.0]})
2495-
2496-
with pytest.raises(TypeError):
2497-
cph.predict_partial_hazard(df_predict_on)
2498-
24992489
def test_strata_will_work_with_matched_pairs(self, rossi, cph):
25002490
rossi["matched_pairs"] = np.floor(rossi.index / 2.0).astype(int)
25012491
cph.fit(rossi, duration_col="week", event_col="arrest", strata=["matched_pairs"], show_progress=True)

0 commit comments

Comments
 (0)