向实体添加变量 - 功能工具



>我正在尝试向实体添加新变量。

我正在尝试添加一个变量,如下所示:

es['Product'].add_variable("inventory", data=inventory_series)

但是我收到此错误:

TypeError: 'Series' objects are mutable, thus they cannot be hashed

如果我将类型参数指定为 int,

es['Product'].add_variable("inventory", data=inventory_series)

我收到不同的错误:

--> 558         new_v = type(new_id, entity=self)
559         self.variables.append(new_v)
560 
TypeError: 'entity' is an invalid keyword argument for this function

有没有另一种方法可以向实体添加新变量?

谢谢

您需要在add_variable中指定数据类型。我想你已经尝试过这种方式:

es['Product'].add_variable('inventory', data=inventory_series, type=int)

并得到此错误:

类型错误:"实体"是此函数的无效关键字参数

但是类型必须是来自featuretools.variable_types的类型。喜欢这个:

es['Product'].add_variable(
'inventory',
data=inventory_series,
type=ft.variable_types.Ordinal
)

最新更新