3

I'm currently working through the feature tools docs using my own data. So far everything worked fine but I got stuck at adding interesting variables. For some reason, I can't make it work and I am not sure why. The example in the doc works just fine.

After creating an entity set I am trying to get features for a specific product Classic Cars:

## Add interesting values
es["products"]["PRODUCTLINE"].interesting_values=["Classic Cars"]

## Get features
feature_defs = ft.dfs(entityset=es,
                            target_entity="customers",
                            agg_primitives=["count"],
                            where_primitives=["count"],
                            trans_primitives=[],
                            features_only=True))

## Show features
feature_defs


OUT[1]: [<Feature: COUNTRY>, <Feature: CUSTOMERNAME>, <Feature: COUNT(transactions)>]

What I would expect is a feature where it counts the number of transactions that include Classic Cars. Unfortunately, it doesn't do that. It also doesn't work with any other variable or value that I tried.

As you can see here the assignment did work.

es["products"]["PRODUCTLINE"].interesting_values

OUT[2]: ['Classic Cars']

And Classic Cars is a valid value of the variable PRODUCTLINE:

es["products"].variables

OUT[3]: [<Variable: PRODUCTCODE (dtype = index)>,
 <Variable: PRODUCTLINE_ID (dtype = numeric)>,
 <Variable: PRODUCTLINE (dtype = categorical)>,
 <Variable: MSRP (dtype = numeric)>]

es["products"].df.PRODUCTLINE.head(2)

OUT[4]: S10_1678     Motorcycles
S10_1949    Classic Cars
Name: PRODUCTLINE, dtype: object

Not sure what I am doing wrong and any help would be appreciated!

Here is the data and the code if you want to reproduce it: https://drive.google.com/open?id=1NOeudbCkeZ66nSOZrhhBdd1jcAa1LDco

FaV1
  • 65
  • 5
  • I accidentally deleted the first version of this post when I wanted to edit it. Apologies. – FaV1 Oct 05 '18 at 22:26
  • 1
    So this issue was generously fixed in this branch of featuretools: https://github.com/Featuretools/featuretools/pull/279 – FaV1 Oct 07 '18 at 23:04

0 Answers0