featuretools.primitives.ExponentialWeightedSTD#
- class featuretools.primitives.ExponentialWeightedSTD(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_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]
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_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