自动表规范化库
autonormalize的Python项目详细描述
自动规格化
autonormalize是一个用于自动数据表规范化的python库。它允许您从单个非规范化表构建EntitySet
,并使用Featuretools生成用于机器学习的特性。
开始
安装
pip install featuretools[autonormalize]
卸载
pip uninstall autonormalize
演示
- Blog Post
- Machine Learning Demo with Featuretools
- Kaggle Liquor Sales Dataset Demo
- Demo with Editing Dependencies
- Kaggle Food Production Dataset Demo
API参考
auto_entityset
auto_entityset(df, accuracy=0.98, index=None, name=None, time_index=None)
从数据帧创建规范化的EntitySet。
参数:
df
(pd.dataframe):包含数据的数据帧accuracy
(0<;float<;=1.00;default=0.98):定义依赖关系所需的精度阈值(即,如果精度=0.98,则0.98行必须为真,依赖关系lhs-->;rhs)index
(str,可选):要作为df索引的列的名称name
(str,可选):创建的实体集的名称time_index
(str,可选):数据帧中时间列的名称。
返回:
entityset
(ft.entity set):创建的实体集
find_dependencies
find_dependencies(df, accuracy=0.98, index=None)
使用dfd搜索算法在dataframe中查找依赖项。
返回:
dependencies
(依赖项):在提供的约束中的数据中找到的依赖项
normalize_dataframe
normalize_dataframe(df, dependencies)
基于给定的依赖关系规范化数据帧。新创建的数据帧的键只能是字符串、Int或类别的列。根据优先级选择键:
- 最短长度
- 以属性的名称以某种形式显示“id”
- 在表中最左边有属性
返回:
new_dfs
(list[pd.dataframe]):新数据帧列表
make_entityset
make_entityset(df, dependencies, name=None, time_index=None)
根据给定的依赖关系从dataframe创建规范化的entityset。键的选择方式与normalize_dataframe
相同,如果任何键具有多个属性,则将创建新索引。
返回:
entityset
(ft.entityset):创建的entityset
normalize_entity
normalize_entity(es, accuracy=0.98)
从具有单个实体的EntitySet
返回新的规范化EntitySet
。
参数:
es
(ft.entityset):要规范化的具有单个实体的entityset
返回:
new_es
(ft.entityset):新的规范化实体集
专题实验室
autonormalize是由Feature Labs创建的开源项目。要查看我们正在开发的其他开源项目,请访问功能实验室Open Source。如果建立有影响力的数据科学管道对您或您的业务很重要,请get in touch。