我目前正在使用我自己的数据处理feature tools docs。到目前为止,一切都很好,但我一直在添加有趣的变量。因为某些原因,我不能让它工作,我不知道为什么。doc中的例子很好用。在
创建实体集后,我尝试获取特定产品的功能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)>]
我所期望的是一个功能,它可以计算包括经典汽车在内的交易数量。不幸的是,事实并非如此。它也不适用于我尝试过的任何其他变量或值。在
正如你在这里看到的,这项作业确实奏效了。在
^{pr2}$经典汽车是变量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
不知道我做错了什么,任何帮助都将不胜感激!在
下面是数据和代码,如果您想复制它:https://drive.google.com/open?id=1NOeudbCkeZ66nSOZrhhBdd1jcAa1LDco
目前没有回答
相关问题 更多 >
编程相关推荐