gpt4 book ai didi

python - [featuretools ]'EntitySet' 对象没有属性 'entity_from_dataframe'

转载 作者:行者123 更新时间:2023-12-05 01:06:12 31 4
gpt4 key购买 nike

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

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

你能帮帮我吗?谢谢。

代码:


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

最佳答案

我得到了答案。

谢谢你,内特。

[新版本]

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

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

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})

关于python - [featuretools ]'EntitySet' 对象没有属性 'entity_from_dataframe',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69665765/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com