featuretools - 您如何搜索特定功能?
问题描述
最后,当我尝试使用 featuretools 时,我正在寻找我所期待的特定功能。当您拥有 > 30 个功能时,查找该功能会非常耗时。
feature_names 对象(dfs 方法的第二个返回对象)是否有搜索某些文本模式(正则表达式)的方法?
feature_names 是“featuretools.feature_base.feature_base.IdentityFeature”的列表
Post Scriptum:在 API 的 featuretools 文档中没有描述返回对象
解决方案
深度特征合成返回特征对象。如果您调用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)
推荐阅读
- php - 无法在 PHP 中获取 XML 响应
- python - 为什么是负数(MSE 或 MAS)评分参数(如 SKLEARN 中的 neg_mean_absolute_error)被考虑用于回归模型评估
- python - Python Matplotlib:如何禁用约束布局但保持轴位置?
- browser - 阻止文件访问请求
- circuit-sdk - ServiceNow 到电路集成
- javascript - 香草 javascript 到 Reactjs 组件?
- python - 正则表达式 Python 法语口音
- python - 我如何在我的代码上修复我的变量,因为它没有出现
- python - 如何从键值对列表构建字典?
- c++ - 为什么 C++ 中的这个正则表达式会在括号表达式异常中抛出无效范围?