Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Sep 20, 2019
1 parent 0d10c9e commit 4dd68d8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion lifelines/fitters/log_normal_fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _create_initial_point(self, Ts, E, *args):
elif CensoringType.is_left_censoring(self):
log_T = np.log(Ts[1])
elif CensoringType.is_interval_censoring(self):
log_T = np.log(Ts[1] - Ts[0])
log_T = np.log(Ts[1])
return np.array([np.median(log_T), 1.0])

@property
Expand Down
10 changes: 0 additions & 10 deletions tests/test_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2486,16 +2486,6 @@ def test_martingale_residuals(self, regression_dataset, cph):
npt.assert_allclose(results.loc[1, "martingale"], 0.774216356429, rtol=1e-05)
npt.assert_allclose(results.loc[199, "martingale"], 0.868510420157, rtol=1e-05)

def test_error_is_raised_if_using_non_numeric_data_in_prediction(self, cph):
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]})

cph.fit(df, duration_col="t")

df_predict_on = pd.DataFrame({"int_": ["1", "-1", "0"], "float_": [1.2, -0.5, 0.0]})

with pytest.raises(TypeError):
cph.predict_partial_hazard(df_predict_on)

def test_strata_will_work_with_matched_pairs(self, rossi, cph):
rossi["matched_pairs"] = np.floor(rossi.index / 2.0).astype(int)
cph.fit(rossi, duration_col="week", event_col="arrest", strata=["matched_pairs"], show_progress=True)
Expand Down

0 comments on commit 4dd68d8

Please sign in to comment.