Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

[featuretools]'EntitySet' object has no attribute 'entity_from_dataframe'

I tried to learn featuretools following documentation from featuretools.com.

A error came up: AttributeError: 'EntitySet' object has no attribute 'entity_from_dataframe'

Could you help me? Thank you.

Code:


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

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

like image 311
Enjoy Avatar asked Sep 08 '26 15:09

Enjoy


2 Answers

I got the answer.

Thank you,Nate.

[NEW version]

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

[OLD version]

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})
like image 92
Enjoy Avatar answered Sep 10 '26 06:09

Enjoy


The documentation you are using is for an older version of Featuretools. You can find the updated Getting Started documentation that works with Featuretools version 1.0 here: https://featuretools.alteryx.com/en/stable/getting_started/getting_started_index.html

like image 30
Nate Parsons Avatar answered Sep 10 '26 04:09

Nate Parsons



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!