msmbuilder.preprocessing.DoubleEWMA¶
-
class
msmbuilder.preprocessing.DoubleEWMA(com=None, span=None, halflife=None, min_periods=0, freq=None, adjust=True)¶ Smooth time-series data using forward and backward exponentially-weighted moving average filters
Parameters: - com : float, optional
Center of mass
- span : float, optional
Specify decay in terms of span
- halflife : float, optional
Specify decay in terms of halflife
- min_periods : int, default 0
Number of observations in sample to require (only affects beginning)
- freq : None or string alias / date offset object, default=None
Frequency to conform to before computing statistic time_rule is a legacy alias for freq
- adjust : boolean, default True
Divide by decaying adjustment factor in beginning periods to account for imbalance in relative weightings (viewing EWMA as a moving average)
References
[1] “Smoothing with Exponentionally Weighted Moving Averages”. Connor Johnson. <http://connor-johnson.com/2014/02/01/smoothing-with-exponentially-weighted-moving-averages/>. Methods
fit(X[, y])Fit Preprocessing to X. fit_transform(sequences[, y])Fit the model and apply preprocessing get_params([deep])Get parameters for this estimator. partial_fit(sequence[, y])Fit Preprocessing to X. partial_transform(sequence)Apply preprocessing to single sequence set_params(**params)Set the parameters of this estimator. summarize()Return some diagnostic summary statistics about this Markov model transform(sequences)Apply preprocessing to sequences -
__init__(com=None, span=None, halflife=None, min_periods=0, freq=None, adjust=True)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__([com, span, halflife, min_periods, …])Initialize self. fit(X[, y])Fit Preprocessing to X. fit_transform(sequences[, y])Fit the model and apply preprocessing get_params([deep])Get parameters for this estimator. partial_fit(sequence[, y])Fit Preprocessing to X. partial_transform(sequence)Apply preprocessing to single sequence set_params(**params)Set the parameters of this estimator. summarize()Return some diagnostic summary statistics about this Markov model transform(sequences)Apply preprocessing to sequences -
fit(X, y=None)¶ Fit Preprocessing to X.
Parameters: - sequence : array-like, [sequence_length, n_features]
A multivariate timeseries.
- y : None
Ignored
Returns: - self
-
fit_transform(sequences, y=None)¶ Fit the model and apply preprocessing
Parameters: - sequences: list of array-like, each of shape (n_samples_i, n_features)
Training data, where n_samples_i in the number of samples in sequence i and n_features is the number of features.
- y : None
Ignored
Returns: - sequence_new : list of array-like, each of shape (n_samples_i, n_components)
-
get_params(deep=True)¶ Get parameters for this estimator.
Parameters: - deep : boolean, optional
If True, will return the parameters for this estimator and contained subobjects that are estimators.
Returns: - params : mapping of string to any
Parameter names mapped to their values.
-
partial_fit(sequence, y=None)¶ Fit Preprocessing to X. Parameters ———- sequence : array-like, [sequence_length, n_features]
A multivariate timeseries.- y : None
- Ignored
self
-
partial_transform(sequence)¶ Apply preprocessing to single sequence
Parameters: - sequence: array like, shape (n_samples, n_features)
A single sequence to transform
Returns: - out : array like, shape (n_samples, n_features)
-
set_params(**params)¶ Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form
<component>__<parameter>so that it’s possible to update each component of a nested object.Returns: - self
-
summarize()¶ Return some diagnostic summary statistics about this Markov model
-
transform(sequences)¶ Apply preprocessing to sequences
Parameters: - sequences: list of array-like, each of shape (n_samples_i, n_features)
Sequence data to transform, where n_samples_i in the number of samples in sequence i and n_features is the number of features.
Returns: - sequence_new : list of array-like, each of shape (n_samples_i, n_components)