How to use the tsfresh.feature_extraction.feature_calculators.absolute_sum_of_changes function in tsfresh

To help you get started, we’ve selected a few tsfresh examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Tencent / Metis / time_series_detector / feature / statistical_features.py View on Github external
def time_series_absolute_sum_of_changes(x):
    """
    Returns the sum over the absolute value of consecutive changes in the series x

    .. math::

        \\sum_{i=1, \ldots, n-1} \\mid x_{i+1}- x_i \\mid

    :param x: the time series to calculate the feature of
    :type x: pandas.Series
    :return: the value of this feature
    :return type: float
    """
    return ts_feature_calculators.absolute_sum_of_changes(x)
github h2oai / driverlessai-recipes / transformers / signal_processing / signal_processing.py View on Github external
"autocorr1": feature_calculators.autocorrelation(sig, 1),
        "autocorr2": feature_calculators.autocorrelation(sig, 2),
        "autocorr3": feature_calculators.autocorrelation(sig, 3),
        "autocorr5": feature_calculators.autocorrelation(sig, 5),
        "autocorr10": feature_calculators.autocorrelation(sig, 10),

        "autocorr_abs_01": feature_calculators.autocorrelation(x=np.abs(sig), lag=1),
        "autocorr_abs_02": feature_calculators.autocorrelation(x=np.abs(sig), lag=2),
        "autocorr_abs_03": feature_calculators.autocorrelation(x=np.abs(sig), lag=3),
        "autocorr_abs_05": feature_calculators.autocorrelation(x=np.abs(sig), lag=5),
        "autocorr_abs_10": feature_calculators.autocorrelation(x=np.abs(sig), lag=10),

        # Trend error
        "trend_stderr": feature_calculators.linear_trend(x=sig, param=[{"attr": "stderr"}])[0][1],

        "abs_change": feature_calculators.absolute_sum_of_changes(x=sig),
        "mean_change": np.mean(diff),
        "ratio_diff": (diff[diff >= 0].sum() + eps) / (diff[diff < 0].sum() + eps),
        "abs_energy": feature_calculators.abs_energy(x=sig - np.mean(sig)),
        "agg_autocorr_mean":
            feature_calculators.agg_autocorrelation(x=sig, param=[{"f_agg": "mean", "maxlag": 10}])[0][
                1],
        "agg_autocorr_std":
            feature_calculators.agg_autocorrelation(x=sig, param=[{"f_agg": "std", "maxlag": 10}])[0][
                1],
        "agg_autocorr_abs_mean":
            feature_calculators.agg_autocorrelation(x=np.abs(sig), param=[{"f_agg": "mean", "maxlag": 10}])[0][1],
        "agg_autocorr_abs_std":
            feature_calculators.agg_autocorrelation(x=np.abs(sig), param=[{"f_agg": "std", "maxlag": 10}])[0][1],

        "binned_entropy": feature_calculators.binned_entropy(x=sig, max_bins=250),
        "cid_ce_normed": feature_calculators.cid_ce(x=sig, normalize=True),