def runner_v2(ndx, serie, period): sr_slice = serie.iloc[ndx:ndx + period] # get feature and name feat, dat = ts_utils.feature_runner(sr_slice, feat_func_list) # collect label lbl = trgt.iloc[ndx] return feat, dat, lbl, ndx
def runner_v2_R(ndx, serie, period): sr_slice = serie.iloc[ndx:ndx + period] # get feature and name feat, dat = ts_utils.feature_runner(sr_slice, [neighbour_quantile_R]) # collect label lbl = trgt.iloc[ndx] return feat, dat, lbl, ndx
def runner_tst(f_name): try: serie = pd.read_csv(os.path.join(tst_path, f_name))['acoustic_data'] except Exception as e: return None, None, None # get feature and name if serie.shape[0] == 150000: feat, dat = ts_utils.feature_runner(serie, feat_func_list) else: feat, dat = None, None return feat, dat, f_name.split('.')[0]
def runner_rgr(ndx, period=150000): serie = trn_pdf['data'].iloc[ndx:ndx + period] # make sure sampling does go out of bound if ndx + period > trn_pdf.shape[0]: return None, None, None # get feature and name feat, dat = ts_utils.feature_runner(serie, feat_func_list) # collect label lbl = trn_pdf['tminus'].iloc[ndx + period - 1] return feat, dat, lbl
def runner_v2_tst(ndx, serie, period): sr_slice = serie.iloc[ndx:ndx + period] # get feature and name feat, dat = ts_utils.feature_runner(sr_slice, feat_func_list) return feat, dat, ndx
def runner_v2_tst_R(ndx, serie, period): sr_slice = serie.iloc[ndx:ndx + period] # get feature and name feat, dat = ts_utils.feature_runner(sr_slice, [neighbour_quantile_R]) return feat, dat, ndx