コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
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]
コード例 #4
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
コード例 #5
0
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
コード例 #6
0
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