featuretools.primitives.ExponentialWeightedSTD#
- class featuretools.primitives.ExponentialWeightedSTD(com=None, span=None, halflife=None, alpha=None, ignore_na=False)[source]#
计算一组数字的指数加权移动标准差
- 描述
返回一组数字的指数加权移动标准差。必须提供质心 (com)、跨度 (span)、半衰期 (halflife) 和 alpha 中的一个且仅一个。通过将 ‘ignore_na’ 设置为 True,可以在计算权重时忽略缺失值。
- 参数:
com (float) – 对于 com >= 0,指定衰减的质心。默认为 None。
span (float) – 对于 span >= 1,指定衰减的跨度。默认为 None。
halflife (float) – 对于 halflife > 0,指定衰减的半衰期。默认为 None。
alpha (float) – 直接指定平滑因子 alpha。Alpha 必须大于 0 且小于或等于 1。默认为 None。
ignore_na (bool) – 计算权重时忽略缺失值。默认为 False。
示例
>>> exponential_weighted_std = ExponentialWeightedSTD(com=0.5) >>> exponential_weighted_std([1, 2, 3, 7]).tolist() [nan, 0.7071067811865475, 0.9198662110077998, 2.9852200022005855]
缺失值可以被忽略
>>> ewmstd_ignorena = ExponentialWeightedSTD(com=0.5, ignore_na=True) >>> ewmstd_ignorena([1, 2, 3, None, 7]).tolist() [nan, 0.7071067811865475, 0.9198662110077998, 0.9198662110077998, 2.9852200022005855]
方法
__init__
([com, span, halflife, alpha, ignore_na])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
()属性
base_of
base_of_exclude
commutative
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