1

I am using deep feature synthesis to create new features. How can I select features from feature_def.

For example, I need to select all the features with string "Age" in it. I tried the following code which gave me an error "argument of type 'IdentityFeature' is not iterable"

    feature_matrix, feature_defs = ft.dfs(entityset= es, target_entity= 'titanic', max_depth= 2)
    features = []
    for s in feature_defs:
      if 'Age' in s:
        features.append(s)
Abin John Thomas
  • 159
  • 2
  • 13

1 Answers1

1

You need to use the .get_name() method on the feature definition. For example,

feature_matrix, feature_defs = ft.dfs(entityset= es, target_entity= 'titanic', max_depth= 2)
features = []
for s in feature_defs:
  if 'Age' in s.get_name():
    features.append(s)
Max Kanter
  • 2,006
  • 6
  • 16