"""
assert hasattr(self, "baseline_hazard_"), "Need to fit model first."
if not hasattr(times, "__iter__"):
times = [times]cum_haz = self.predict_cumulative_hazard(df, baseline_hazard_, batch_size, verbose)
times_idx = search_sorted_idx(cum_haz.index.values, times)
cum_haz = cum_haz.iloc[times_idx]
if return_df:
return cum_haz
return cum_haz.as_matrix()
def predict_survival_at_times(self, times, df, baseline_hazard_=None, batch_size=512,
return_df=True, verbose=0):
"""Predict survival function at given times.