1

As soon as I enter time_index='date' parameter in es.entity_from_dataframe(..) in the code below, ft.dfs(..) throws a long list of errors starting from Type Error. I am using google colab with featuretools version 0.4.1.

import pandas as pd

import featuretools as ft

df1 = pd.DataFrame({'df_index' : [1,2,3,4,5],
                 'location':['aust','aust','aust','canada','canada'],
                  'prices':[34,52,46,25,67],
                   'values':[786,345,123,654,841]
                  })

es = ft.EntitySet(id='Transactions')

es.entity_from_dataframe(entity_id='log', 
                         dataframe=df1, 
                         index='df_index',
                         time_index='date'
                        )

es.normalize_entity(base_entity_id='log', new_entity_id='loc', index= 'location' )


fm, features = ft.dfs(entityset=es, target_entity='log',
                      trans_primitives = ['add', 'multiply'],
                      agg_primitives = ['sum', 'mean'],
                      max_depth = 2,
                      verbose = 2
                     )

1 Answers1

1

Colab bundles featuretools 0.4.1 presently, and I suspect you're using newer APIs. I'd start by upgrading the featuretools library like so:

!pip install -U featuretools

After that, you'll need to restart your Python process using the Runtime -> Restart menu.

enter image description here

Then, you'll see a different error like:

LookupError: Time index not found in dataframe

But, I think that's because you're referencing a date column that isn't present in your DataFrame variable df1.

Bob Smith
  • 36,107
  • 11
  • 98
  • 91