alteryx / autonormalize

python library for automated dataset normalization
https://blog.featurelabs.com/automatic-dataset-normalization-for-feature-engineering-in-python/
BSD 3-Clause "New" or "Revised" License
111 stars 16 forks source link

AttributeError is raised when running autonormalize #39

Closed thehomebrewnerd closed 2 years ago

thehomebrewnerd commented 2 years ago

Running autonormalize on the example below results in an AttributeError due to incompatibilities with Featuretools versions >= 1.0.0.

import pandas as pd
import featuretools as ft

from autonormalize import autonormalize as an

input_df = pd.DataFrame(
    {
        'ip_address': ['128.101.101.101', '1.120.0.0', '17.86.21.0', '23.1.23.255'],
        'length': [900, 60, 20, 30],
        'city': ['adl', 'syd', 'adl', 'syd'],
        'country': ['aus', 'aus', 'aus', 'aus'],
        'is_threat': [True, False, False, False]
    }
)

es = ft.EntitySet()
es.add_dataframe(dataframe_name="data",
                 dataframe=input_df,
                 index="index",
                 make_index=True)

normalized_es = an.normalize_entity(es)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-17-8983b2603bf4> in <module>
----> 1 normalized_es = an.normalize_entity(es)

~/dev/autonormalize/autonormalize/autonormalize.py in normalize_entity(es, accuracy)
    156     # to normalize while preserving existing relationships
    157 
--> 158     if len(es.entities) > 1:
    159         raise ValueError('There is more than one entity in this EntitySet')
    160     if len(es.entities) == 0:

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