featuretools.primitives.Entropy#

class featuretools.primitives.Entropy(dropna=False, base=None)[source]#

计算分类列的熵

描述

给定分类列的观测值列表,返回该分布的熵。NaN 值可以被视为一个类别或被丢弃。

参数:
  • dropna (bool) – 是否将 NaN 值视为一个单独的类别。默认为 False。

  • base (float) – 要使用的对数底数。默认为 e (自然对数)

示例

>>> pd_entropy = Entropy()
>>> pd_entropy([1, 2, 3, 4])
1.3862943611198906
__init__(dropna=False, base=None)[source]#

方法

__init__([dropna, base])

flatten_nested_input_types(input_types)

将嵌套的列 schema 输入展平为单个列表。

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

属性

base_of

base_of_exclude

commutative

default_value

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

description_template

input_types

输入数据的 woodwork.ColumnSchema 类型

max_stack_depth

name

primitive 的名称

number_output_features

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

return_type

返回值的 ColumnSchema 类型

stack_on

stack_on_exclude

stack_on_self

uses_calc_time