本文主要是介绍机器学习特征提取 | 自动特征工程featuretools,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、什么是Featuretools?
为了能使框架普适,就像pandas用于数据准备或scikit-learn用于机器学习。
链接:https://www.featuretools.com/
2、安装
通过源码安装,代码如下:
git clone https://github.com/featuretools/featuretools.git
cd featuretools
python setup.py install
通过pip安装,命令如下:
pip install featuretools
3、五分钟快速开始
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
这篇关于机器学习特征提取 | 自动特征工程featuretools的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!