您如何搜索特定功能?

时间:2019-07-01 18:01:06

标签: featuretools

最后,当我尝试使用featuretools时,我正在寻找期望的特定功能。当您具有> 30个功能时,找到该功能会很耗时。

feature_names对象(dfs方法的第二个返回对象)是否具有搜索某些文本模式(正则表达式)的方法?

feature_names是“ featuretools.feature_base.feature_base.IdentityFeature”的列表

后脚本:在API的featuretools文档中,未描述返回对象

1 个答案:

答案 0 :(得分:1)

深度特征合成返回特征对象。如果您在其中一个对象上调用FeatureBase.get_name(),它将以字符串形式返回名称。您可以使用它来实现您想要的任何选择逻辑。例如,下面的代码列出了名称为amount的所有要素对象

import featuretools as ft

es = ft.demo.load_mock_customer(return_entityset=True)

fl = ft.dfs(target_entity="customers", entityset=es, features_only=True)

keep = []

for feature in fl:
    if "amount" in feature.get_name():
        keep.append(feature)   
相关问题