INNER CODE UNIT · Python
create_features
alteryx/open_source_demos · predict-correct-answer/utils.py:99
def create_features(es, label='Outcome', custom_agg=[]):
cutoff_times = es['transactions'].df[['Transaction Id', 'End Time', label]]
fm, features = ft.dfs(entityset=es,
target_entity='transactions',
agg_primitives=[Sum, Mean] + custom_agg,
trans_primitives=[Hour],
max_depth=3,
approximate='2m',
cutoff_time=cutoff_times,
verbose=True)
fm_enc, _ = ft.encode_features(fm, features)
fm_enc = fm_enc.fillna(0)
fm_enc = remove_low_information_features(fm_enc)
labels = fm.pop(label)
return (fm_enc, labels)
def estimate_score(fm_enc, label, splitter):