featuretools.primitives.ExponentialWeightedVariance#

class featuretools.primitives.ExponentialWeightedVariance(com=None, span=None, halflife=None, alpha=None, ignore_na=False)[source]#

计算一系列数字的指数加权移动方差

Description:

返回一系列数字的指数加权移动方差.必须提供中心质量(com)、跨度(span)、半衰期(half-life)和alpha中的一个. 通过将’ignore_na’设置为True,可以在计算权重时忽略缺失值.

Parameters:
  • 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.

Examples

>>> exponential_weighted_variance = ExponentialWeightedVariance(com=0.5)
>>> exponential_weighted_variance([1, 2, 3, 4]).tolist()
[nan, 0.49999999999999983, 0.8461538461538459, 1.1230769230769233]

可以忽略缺失值

>>> ewmv_ignorena = ExponentialWeightedVariance(com=0.5, ignore_na=True)
>>> ewmv_ignorena([1, 2, 3, None, 4]).tolist()
[nan, 0.49999999999999983, 0.8461538461538459, 0.8461538461538459, 1.1230769230769233]
__init__(com=None, span=None, halflife=None, alpha=None, ignore_na=False)[source]#

Methods

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

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