【问题标题】:Including only certain features when running deep feature synthesis?运行深度特征合成时只包括某些特征?
【发布时间】:2019-03-25 22:02:23
【问题描述】:

例如,我的一个实体有两组 ID。 一个是连续的(这显然是创建 EntitySet 所必需的),另一个是在与我的另一个表合并时用作外键。

这会导致特征工具包含要聚合的特征集中的 ID。 SUM(ID) 不是我感兴趣的功能。

有没有办法在运行深度特征合成时包含某些特征?

【问题讨论】:

    标签: featuretools


    【解决方案1】:

    调用ft.dfs时有三种排除特征的方式。

    • 使用ignore_variables 指定实体中不应用于创建特征的变量。它是一个字典,将实体 id 映射到要忽略的变量名列表。

    • 使用drop_contains 删除包含任何字符串的特征 列在此参数中。

    • 使用drop_exact 删除与此参数中列出的任何字符串完全匹配的特征。

    这是ft.dfs 调用中所有三个的示例用法

    ft.dfs(target_entity="customers"],
           ignore_variables={
               "transactions": ["amount"],
               "customers": ["age", "gender", "date_of_birth"]
           }, # ignore these variables
           drop_contains=["customers.SUM("],  # drop features that contain these strings
           drop_exact=["STD(transactions.quanity)"],  # drop features named exactly this
           ...
     )
    

    这 3 个参数都记录在 here 中。

    如果您获得不想要的功能,最后要考虑的是实体集中变量的变量类型。如果您看到一个 ID 变量的总和,这一定意味着 featuretools 认为 ID 变量是一个数值。如果您告诉 featuretools 它是一个 ID,它将不会对其应用数字聚合。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-03
      • 1970-01-01
      • 1970-01-01
      • 2018-10-13
      • 2017-03-24
      • 1970-01-01
      • 2020-12-20
      相关资源
      最近更新 更多