首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >[featuretools]'EntitySet‘对象没有'entity_from_dataframe’属性

[featuretools]'EntitySet‘对象没有'entity_from_dataframe’属性
EN

Stack Overflow用户
提问于 2021-10-21 16:41:00
回答 2查看 914关注 0票数 1

我试着按照featuretools.com上的文档来学习功能工具。

出现错误: AttributeError:'EntitySet‘对象没有属性'entity_from_dataframe’

你能帮我一下吗?谢谢。

代码:

代码语言:javascript
复制
import featuretools as ft

data = ft.demo.load_mock_customer()
transactions_df = data["transactions"].merge(data["sessions"]).merge(data["customers"])
transactions_df.sample(10)
products_df = data["products"]
products_df
es = ft.EntitySet(id="customer_data")
es = es.entity_from_dataframe(entity_id="transactions",
                              dataframe=transactions_df,
                             index="transaction_id",
                              time_index="transaction_time",
                              variable_types={"product_id": ft.variable_types.Categorical,
                                               "zip_code": ft.variable_types.ZIPCode})

es

代码来源:https://docs.featuretools.com/en/v0.16.0/loading_data/using_entitysets.html#creating-entity-from-existing-table

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-10-21 17:08:40

您正在使用的文档适用于旧版本的Featuretools。您可以在以下位置找到适用于要素工具版本1.0的更新入门文档:https://featuretools.alteryx.com/en/stable/getting_started/getting_started_index.html

票数 3
EN

Stack Overflow用户

发布于 2021-10-21 17:27:01

我知道答案了。

谢谢你内特。

新版本

https://featuretools.alteryx.com/en/stable/getting_started/getting_started_index.html

代码语言:javascript
复制
from woodwork.logical_types import Categorical, PostalCode

es = es.add_dataframe(
    dataframe_name="transactions",
    dataframe=transactions_df,
    index="transaction_id",
    time_index="transaction_time",
    logical_types={
        "product_id": Categorical,
        "zip_code": PostalCode,
    },
)

es

旧版本

https://docs.featuretools.com/en/v0.16.0/loading_data/using_entitysets.html#creating-entity-from-existing-table

代码语言:javascript
复制
es = es.entity_from_dataframe(entity_id="transactions",
                              dataframe=transactions_df,
                             index="transaction_id",
                              time_index="transaction_time",
                              variable_types={"product_id": ft.variable_types.Categorical,
                                               "zip_code": ft.variable_types.ZIPCode})
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69665765

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档