我有一个关于featuretools的make_agg_premitives
函数的问题。你知道吗
在我的数据中,有些值是由列表格式组成的。你知道吗
例如
id products
a ['a', 'b', 'c']
b ['a','c']
a ['a','c']
我想使用各种自定义函数聚合products
列:
def len_lists(values):
return len(a)
len_ = make_agg_primitive(function = len_lists,
input_types = [?????],
return_type = ft.variable_types.Numeric,
description="length of a list related instance")
可以使用featuretools创建自定义变量类型,该类型可与自定义基元一起使用,以生成所需的变换特征。你知道吗
使用您的示例,让我们创建一个自定义列表类型
现在,让我们使用新的列表类型创建一个自定义转换原语,并为包含列表变量类型的简单entityset生成特性。你知道吗
现在可以查看生成的特征,其中包括使用自定义变换原语的特征
谢谢你!多亏了你,我要做各种各样的功能!你知道吗
在代码中 定义长度列表(值): 返回值.str.len()
值的格式是dataframe,对吗?你知道吗
相关问题 更多 >
编程相关推荐