How to use the tsfresh.feature_extraction.feature_calculators.agg_linear_trend 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 pdkit / pdkit / pdkit / tremor_processor.py View on Github external
The chunksize is regulated by "chunk_len". It specifies how many time series values are in each chunk.

            Further, the aggregation function is controlled by "f_agg", which can use "max", "min" or , "mean", "median"

            :param x: the time series to calculate the feature of
            :type x: pandas.Series
            :param param: contains dictionaries {"attr": x, "chunk_len": l, "f_agg": f} with x, f a str and l an int
            :type param: list
            :return: the different feature values
            :rtype: pandas.Series
        """
        if param is None:
            param = [{'attr': 'intercept', 'chunk_len': 5, 'f_agg': 'min'},
                     {'attr': 'rvalue', 'chunk_len': 10, 'f_agg': 'var'},
                     {'attr': 'intercept', 'chunk_len': 10, 'f_agg': 'min'}]
        agg = feature_calculators.agg_linear_trend(x, param)
        logging.debug("agg linear trend by tsfresh calculated")
        return list(agg)
github FeatureLabs / featuretools-tsfresh-primitives / featuretools_tsfresh_primitives / primitives / agg_linear_trend.py View on Github external
def function(x):
            x = to_array(x)
            param = [{'attr': self.attr, 'f_agg': self.f_agg, 'chunk_len': self.chunk_len}]
            return list(agg_linear_trend(x, param))[0][1]