在特征工具中使用 cutoff_times 进行预测
Using cutoff_times in featuretools for prediction
我正在构建一个模型来预测用户是否会根据 his/her 阅读历史等 (activity) 购买订阅。我正在使用 featuretools
(https://www.featuretools.com/) 来自动化特征工程,这就是它变得棘手的地方:
鉴于以下情况,我应该如何决定训练数据的截止时间/window:
- 培训应该持续多长时间 window 是 1 个月、6 个月等?
- 考虑到用户 activity 的预订阅和 post 订阅可能不同,我应该根据当前订阅者的订阅时间截断数据(防止泄露)。但是我应该什么时候停止非订阅者?
feature_matrix, feature_defs = ft.dfs(entityset=es,
target_entity="users",
max_depth=2,
agg_primitives=["sum", "std", "max", "min", "mean", "median", "count", "percent_true", "num_unique", "mode",
"avg_time_between"],
trans_primitives=["day", "year", "month", "weekday", "time_since_previous", "time_since", "is_weekend"],
cutoff_time=cutoff_times,
cutoff_time_in_index=True,
training_window=ft.Timedelta(180,"d"),
n_jobs=8, verbose=True)
如何决定训练数据的截止时间取决于以下因素:
How long should the training window be 1 month, 6 months, etc?
我认为您可以尝试不同的训练 window 尺寸,看看哪个模型的效果更好。
Given that user activity may be different pre and post subscription, I should cutoff data for current subscribers based on when they subscribed (prevent leakage). But when I should I cutoff for non-subscribers?
我认为您可以随机选择它们,或者选择代表您将来何时在这些订阅者上使用该模型的时间。
我们的开源库 Compose 非常适合构建此标记过程。如果您在 Compose 中定义预测问题,它会根据您定义预测问题的方式自动 select 负面示例。它还具有参数化预测 window,可让您在特定时间生成标签。让我知道这是否有帮助。
我正在构建一个模型来预测用户是否会根据 his/her 阅读历史等 (activity) 购买订阅。我正在使用 featuretools
(https://www.featuretools.com/) 来自动化特征工程,这就是它变得棘手的地方:
鉴于以下情况,我应该如何决定训练数据的截止时间/window:
- 培训应该持续多长时间 window 是 1 个月、6 个月等?
- 考虑到用户 activity 的预订阅和 post 订阅可能不同,我应该根据当前订阅者的订阅时间截断数据(防止泄露)。但是我应该什么时候停止非订阅者?
feature_matrix, feature_defs = ft.dfs(entityset=es,
target_entity="users",
max_depth=2,
agg_primitives=["sum", "std", "max", "min", "mean", "median", "count", "percent_true", "num_unique", "mode",
"avg_time_between"],
trans_primitives=["day", "year", "month", "weekday", "time_since_previous", "time_since", "is_weekend"],
cutoff_time=cutoff_times,
cutoff_time_in_index=True,
training_window=ft.Timedelta(180,"d"),
n_jobs=8, verbose=True)
如何决定训练数据的截止时间取决于以下因素:
How long should the training window be 1 month, 6 months, etc?
我认为您可以尝试不同的训练 window 尺寸,看看哪个模型的效果更好。
Given that user activity may be different pre and post subscription, I should cutoff data for current subscribers based on when they subscribed (prevent leakage). But when I should I cutoff for non-subscribers?
我认为您可以随机选择它们,或者选择代表您将来何时在这些订阅者上使用该模型的时间。
我们的开源库 Compose 非常适合构建此标记过程。如果您在 Compose 中定义预测问题,它会根据您定义预测问题的方式自动 select 负面示例。它还具有参数化预测 window,可让您在特定时间生成标签。让我知道这是否有帮助。