功能工具中是否有用于交互的内置原语?
Are there built-in primitives for interactions in Feature tools?
是否有内置原语执行两个数字列之间的绝对和相对差异?两个日期列?
目前可以对数字列执行此操作,但不能对日期时间执行此操作。
对于交互项,我们通常建议您手动定义所需的特定功能。例如,这里是如何定义数字特征之间的差异和绝对差异
import featuretools as ft
es = ft.demo.load_retail(nrows=1000)
total = ft.Feature(es["order_products"]["total"])
unit_price = ft.Feature(es["order_products"]["unit_price"])
difference = unit_price - total
absolute_diff = abs(difference)
fm = ft.calculate_feature_matrix(features=[difference, absolute_diff], entityset=es)
fm.head()
这个returns
unit_price - total ABSOLUTE(unit_price - total)
order_product_id
0 -21.0375 21.0375
1 -27.9675 27.9675
2 -31.7625 31.7625
3 -27.9675 27.9675
4 -27.9675 27.9675
如果我们希望其他基元堆叠在它们之上,我们也可以将这些值传递给 ft.dfs
作为 seed features。
是否有内置原语执行两个数字列之间的绝对和相对差异?两个日期列?
目前可以对数字列执行此操作,但不能对日期时间执行此操作。
对于交互项,我们通常建议您手动定义所需的特定功能。例如,这里是如何定义数字特征之间的差异和绝对差异
import featuretools as ft
es = ft.demo.load_retail(nrows=1000)
total = ft.Feature(es["order_products"]["total"])
unit_price = ft.Feature(es["order_products"]["unit_price"])
difference = unit_price - total
absolute_diff = abs(difference)
fm = ft.calculate_feature_matrix(features=[difference, absolute_diff], entityset=es)
fm.head()
这个returns
unit_price - total ABSOLUTE(unit_price - total)
order_product_id
0 -21.0375 21.0375
1 -27.9675 27.9675
2 -31.7625 31.7625
3 -27.9675 27.9675
4 -27.9675 27.9675
如果我们希望其他基元堆叠在它们之上,我们也可以将这些值传递给 ft.dfs
作为 seed features。