功能工具分类处理

2024-06-10 06:18:02 发布

您现在位置:Python中文网/ 问答频道 /正文

Featuretools提供了处理分类变量的集成功能

variable_types={"product_id": ft.variable_types.Categorical} https://docs.featuretools.com/loading_data/using_entitysets.html

但是,这些类型应该是strings还是pandas.Category类型,以便与Featuretools实现最佳兼容性?在

编辑

另外,是否需要像在中那样手动指定所有列 https://github.com/Featuretools/predict-appointment-noshow/blob/master/Tutorial.ipynb或者它们会自动从拟合pandas数据类型中推断出来吗

import featuretools.variable_types as vtypes
variable_types = {'gender': vtypes.Categorical,
                  'patient_id': vtypes.Categorical,
                  'age': vtypes.Ordinal,
                  'scholarship': vtypes.Boolean,
                  'hypertension': vtypes.Boolean,
                  'diabetes': vtypes.Boolean,
                  'alcoholism': vtypes.Boolean,
                  'handicap': vtypes.Boolean,
                  'no_show': vtypes.Boolean,
                  'sms_received': vtypes.Boolean}

Tags: https功能comid类型pandas分类product
1条回答
网友
1楼 · 发布于 2024-06-10 06:18:02

将数据加载到Featuretools时,应该使用Pandas Category dtype。与使用字符串相比,这将大大节省内存使用量。在

加载数据时不需要手动指定每个变量类型。如果没有提供,Featuretools将尝试从Pandas数据类型推断它。在

相关问题 更多 >