タイトルに全てを記入できませんでした。

featuretoolsを使用する際に発生したエラーで、全文は

'EntitySet' object has no attribute 'entity_from_dataframe'

です。

 

調べると、featuretoolsのバージョンが新しくなったことで、コードの変更が必要なようです。

 

私は下記のように変更することで動作いたしました。

 

====エラーが出たコード=================================

import featuretools as ft
df_ = df_train.loc[:,"aaa":"zzz"]
es = ft.EntitySet(id='example')
es = es.entity_from_dataframe(entity_id='locations',
                              dataframe=df_,
                              index='name')
feature_matrix, feature_defs = ft.dfs(entityset=es,
                                      target_entity='locations',
                                      trans_primitives=['add_numeric', 'subtract_numeric','divide_numeric','multiply_numeric'],
                                      agg_primitives=[],
                                      max_depth=1)

====エラーが出たコード==================================

 

====エラーが出なくなったコード============================

import featuretools as ft
df_ = df_train.loc[:,"aaa":"zzz"]
es = ft.EntitySet(id='example')
es = es.add_dataframe(dataframe_name='locations',
                              dataframe=df_,
                              index='name')
feature_matrix, feature_defs = ft.dfs(entityset=es,
                                      target_dataframe_name="locations",
                                      trans_primitives=['add_numeric', 'subtract_numeric','divide_numeric','multiply_numeric'],
                                      agg_primitives=[],
                                      max_depth=1)

====エラーが出なくなったコード============================

 

突然動作しなくなって困りました。

素人からすると、バージョンアップでコードの変更をしないで欲しいですぅ。。。