Skip to content

Instantly share code, notes, and snippets.

@WillKoehrsen
Last active October 23, 2018 19:27
Show Gist options
  • Save WillKoehrsen/0197ac32c28fa045bb9c7de92c75cc46 to your computer and use it in GitHub Desktop.
Save WillKoehrsen/0197ac32c28fa045bb9c7de92c75cc46 to your computer and use it in GitHub Desktop.
import featuretools as ft
# Primitives for deep feature synthesis
trans_primitives = ['weekend', 'cum_sum', 'day', 'month', 'diff', 'time_since_previous']
agg_primitives = ['sum', 'time_since_last', 'avg_time_between', 'all', 'mode',
'num_unique', 'min', 'last', 'mean', 'percent_true',
'max', 'std', 'count']
# Perform deep feature synthesis
feature_matrix, feature_names = ft.dfs(entityset=es,
trans_primitives = trans_primitives,
agg_primitives = agg_primitives,
target_entity='customers',
cutoff_times=cutoff_times)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment