featuretools.primitives.ExponentialWeightedSTD#
- class featuretools.primitives.ExponentialWeightedSTD(com=None, span=None, halflife=None, alpha=None, ignore_na=False)[source]#
Computes the exponentially weighted moving standard deviation for a series of numbers
- Description:
Returns the exponentially weighted moving standard deviation for a series of numbers. Exactly one of center of mass (com), span, half-life, and alpha must be provided. Missing values can be ignored when calculating weights by setting ‘ignore_na’ to True.
- Parameters:
com (float) – Specify decay in terms of center of mass for com >= 0. Default is None.
span (float) – Specify decay in terms of span for span >= 1. Default is None.
halflife (float) – Specify decay in terms of half-life for halflife > 0. Default is None.
alpha (float) – Specify smoothing factor alpha directly. Alpha should be greater than 0 and less than or equal to 1. Default is None.
ignore_na (bool) – Ignore missing values when calculating weights. Default is False.
Examples
>>> exponential_weighted_std = ExponentialWeightedSTD(com=0.5) >>> exponential_weighted_std([1, 2, 3, 7]).tolist() [nan, 0.7071067811865475, 0.9198662110077998, 2.9852200022005855]
Missing values can be ignored
>>> 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)Flattens nested column schema inputs into a single list.
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
compatibility
Additional compatible libraries
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
series_library
stack_on
stack_on_exclude
stack_on_self
uses_calc_time
uses_full_dataframe