def install_trend_k_feature(df, origin):
    func = partial(trend_in_last_k_instalment_features, periods=[5, 10, 50])
    groupby = origin.groupby(['SK_ID_CURR'])
    g = parallel_apply(groupby, func, index_name='SK_ID_CURR',
                       num_workers=4).reset_index()
    df = pd.merge(df, g, on=['SK_ID_CURR'], how='left')
    return df
def pos_cash_trend_installment(df, origin):
    groupby = origin.groupby(['SK_ID_CURR'])
    func = partial(trend_in_last_k_installment_features,
                   periods=[1, 6, 12, 30, 60])
    g = parallel_apply(groupby, func, index_name='SK_ID_CURR',
                       num_workers=8).reset_index()
    df = pd.merge(df, g, on=['SK_ID_CURR'], how='left')
    return df
示例#3
0
def pos_cash_last_loan(df, origin):
    groupby = origin.groupby(['SK_ID_CURR'])
    g = parallel_apply(groupby,
                       last_loan_features,
                       index_name='SK_ID_CURR',
                       num_workers=8).reset_index()
    df = pd.merge(df, g, on=['SK_ID_CURR'], how='left')
    return df
def install_last_k_feature(df, origin):
    func = partial(last_k_instalment_features, periods=[1, 5, 10, 20, 50, 100])
    groupby = origin.groupby(['SK_ID_CURR'])
    g = parallel_apply(groupby, func, index_name='SK_ID_CURR',
                       num_workers=8).reset_index()
    g = correlation_reduce(g)
    df = pd.merge(df, g, on=['SK_ID_CURR'], how='left')
    return df
def bureau_trend_features(df, bureau):
    groupby = bureau.groupby(['SK_ID_CURR'])
    g = parallel_apply(groupby, trend_in_last_k_bureau_features,
                        index_name = 'SK_ID_CURR', num_workers = 8).reset_index()
    df = pd.merge(df, g, on = ['SK_ID_CURR'], validate = 'one_to_one')
    return df