AttributeError:'EntitySet'对象在featuretools中没有属性'plot'

时间:2019-02-17 10:56:23

标签: python-3.x featuretools

尝试运行命令时出现此异常:

es.plot()

AttributeError: 'EntitySet' object has no attribute 'plot'

es对象是Featuretools中的“ EntitySet”类对象。

我使用以下命令创建了es:

es = es.entity_from_dataframe(entity_id = 'orders',
                             dataframe = orders,
                             index = 'order_id',
                             variable_types = {

                                 'user_id' : ft.variable_types.Categorical,

                                 'eval_set' : ft.variable_types.Categorical,

                                 'order_number' : ft.variable_types.Numeric,

                                 'order_dow' : ft.variable_types.Numeric,

                                 'order_hour_of_day' : ft.variable_types.Numeric,

                                 'days_since_prior_order' : ft.variable_types.Numeric
                             })

es = es.entity_from_dataframe(entity_id = 'products',
                             dataframe = products,
                             index = 'product_id',
                             variable_types = {

                                 'product_name' : ft.variable_types.Categorical,

                                 'aisle_id' : ft.variable_types.Categorical,

                                 'department_id' : ft.variable_types.Categorical
                             })

es = es.entity_from_dataframe(entity_id = 'departments',
                             dataframe = departments,
                             index = 'department_id',
                             variable_types = {

                                 'department' : ft.variable_types.Categorical
                             })

es = es.entity_from_dataframe(entity_id = 'aisles',
                             dataframe = aisles,
                             index = 'aisle_id',
                             variable_types = {

                                 'aisle' : ft.variable_types.Categorical
                             })

可以在此处获取数据:https://www.instacart.com/datasets/grocery-shopping-2017

我正在尝试遵循Featuretools教程,该教程名为:使用自动功能工程预测客户的下一次购买

有关Featuretools的更多信息,请参见:https://docs.featuretools.com/index.html

1 个答案:

答案 0 :(得分:0)

EntitySet.plot()已在Featuretools v0.6.0中添加。确保您使用的是最新的Featuretools版本。您可以通过运行以下命令使用pip进行安装

pip install --upgrade featuretools