MCPcopy Create free account
hub / github.com/AIRMEC/HECTOR / get_bins_time_value

Function get_bins_time_value

utils.py:198–207  ·  view source on GitHub ↗
(df, n_bins, time_col_name, label_time_col_name='disc_label', censorship_col_name='censorship')

Source from the content-addressed store, hash-verified

196 return max_time, y
197
198def get_bins_time_value(df, n_bins, time_col_name, label_time_col_name='disc_label', censorship_col_name='censorship'):
199 # Retrieve the values of each bin from the dataset.
200 # Note that this was done on the uncensored cases.
201 uncensored_df = df[df[censorship_col_name]==0]
202 labels, q_bins = pd.qcut(uncensored_df[time_col_name], q=n_bins, retbins=True, labels=False)
203 q_bins[0] = 0
204 q_bins[-1] = float('inf')
205
206 # Current q_bins list length == n bins + 1. There is no need to return q_bins[0]==0.
207 return q_bins[1::]
208
209def compute_surv_metrics_eval(
210 bins_values,

Callers 1

prepare_datasetsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected