我试着按照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发布于 2021-10-21 17:08:40
您正在使用的文档适用于旧版本的Featuretools。您可以在以下位置找到适用于要素工具版本1.0的更新入门文档:https://featuretools.alteryx.com/en/stable/getting_started/getting_started_index.html
发布于 2021-10-21 17:27:01
我知道答案了。
谢谢你内特。
新版本
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旧版本
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})https://stackoverflow.com/questions/69665765
复制相似问题