featuretools.primitives.NumberOfUniqueWords#

class featuretools.primitives.NumberOfUniqueWords(case_insensitive=False)[source]#

确定字符串中唯一单词的数量.

Description:

确定给定字符串中唯一单词的数量.包含对大小写不敏感行为的选项.

Parameters:
  • case_insensitive (bool, 可选) – 指定在搜索唯一单词时是否忽略大小写.

  • 例如

  • word"将被视为一个唯一单词.默认为False. (设置为True意味着"WORD) –

Examples

>>> x = ['Word word Word', 'This is a SENTENCE.', 'green red green']
>>> number_of_unique_words = NumberOfUniqueWords()
>>> number_of_unique_words(x).tolist()
[2, 4, 2]
>>> x = ['word WoRD WORD worD', 'dog dog dog', 'catt CAT caT']
>>> number_of_unique_words = NumberOfUniqueWords(case_insensitive=True)
>>> number_of_unique_words(x).tolist()
[1, 1, 2]
__init__(case_insensitive=False)[source]#

Methods

__init__([case_insensitive])

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()

Attributes

base_of

base_of_exclude

commutative

default_value

Default value this feature returns if no data found.

description_template

input_types

woodwork.ColumnSchema types of inputs

max_stack_depth

name

Name of the primitive

number_output_features

Number of columns in feature matrix associated with this feature

return_type

ColumnSchema type of return

stack_on

stack_on_exclude

stack_on_self

uses_calc_time

uses_full_dataframe