featuretools.primitives.NumberOfMentions#

class featuretools.primitives.NumberOfMentions[source]#

确定字符串中的提及数量。

说明

给定一个字符串列表,确定每个字符串中的提及数量。

提及被定义为满足以下标准的字符串
  • 以“@”字符开头,后跟一串字母数字字符

  • 出现在字符串开头或空格之后

  • 以字符串结尾、空格或除“@”以外的标点符号终止
    • 例如,字符串 @yes-no’ 包含一个有效的提及 (@yes’)

    • 例如,字符串“@yes@”不包含有效的提及

此实现支持 Unicode 字符。

此实现对提及没有字符限制。

如果字符串缺失,则返回 NaN

示例

>>> x = ['@user1 @user2', 'this is a string', '@@@__user1@1and_0@expression']
>>> number_of_mentions = NumberOfMentions()
>>> number_of_mentions(x).tolist()
[2.0, 0.0, 0.0]
__init__()[source]#

方法

__init__()

flatten_nested_input_types(input_types)

将嵌套的列模式输入展平为一个列表。

generate_name(base_feature_names)

generate_names(base_feature_names)

get_args_string()

get_arguments()

get_description(input_column_descriptions[, ...])

get_filepath(filename)

get_function()

process_text(text)

属性

base_of

base_of_exclude

可交换的

default_value

如果未找到数据,则此特征返回的默认值。

description_template

input_types

woodwork.ColumnSchema 输入类型

max_stack_depth

name

原语的名称

number_output_features

与此特征关联的特征矩阵中的列数

return_type

ColumnSchema 返回类型

stack_on

stack_on_exclude

stack_on_self

uses_calc_time

uses_full_dataframe