为了能使框架普适,就像pandas用于数据准备或scikit-learn用于机器学习。
链接:https://www.featuretools.com/
通过源码安装,代码如下:
git clone https://github.com/featuretools/featuretools.git
cd featuretools
python setup.py install
通过pip安装,命令如下:
pip install featuretools
1)首先导入相关包:
In [1]: import featuretools as ft
2)准备相关数据:
In [2]: data = ft.demo.load_mock_customer()
In [3]: customers_df = data["customers"]
In [5]: sessions_df = data["sessions"]
In [7]: transactions_df = data["transactions"]
In [10]: relationships = [("sessions", "session_id", "transactions", "session_id"),
....: ("customers", "customer_id", "sessions", "customer_id")]
3)特征综合:
In [11]: feature_matrix_customers, features_defs = ft.dfs(entities=entities,
....: relationships=relationships,
....: target_entity="customers")
In [12]: feature_matrix_customers
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有