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]
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_ofbase_of_excludecommutativedefault_valueDefault value this feature returns if no data found.
description_templateinput_typeswoodwork.ColumnSchema types of inputs
max_stack_depthnameName of the primitive
number_output_featuresNumber of columns in feature matrix associated with this feature
return_typeColumnSchema type of return
stack_onstack_on_excludestack_on_selfuses_calc_timeuses_full_dataframe