How to use the tsfresh.feature_extraction.feature_calculators.ratio_value_number_to_time_series_length 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
def ratio_value_number_to_time_series_length(self, x):
        """
            As in tsfresh `ratio_value_number_to_time_series_length `_

            Returns a factor which is 1 if all values in the time series occur only once,
            and below one if this is not the case.
            In principle, it just returns: # unique values / # values

            :param x: the time series to calculate the feature of
            :type x: pandas.Series
            :return: the value of this feature
            :rtype: float
        """
        ratio = feature_calculators.ratio_value_number_to_time_series_length(x)
        logging.debug("ratio value number to time series length by tsfresh calculated")
        return ratio
github Tencent / Metis / time_series_detector / feature / statistical_features.py View on Github external
def time_series_ratio_value_number_to_time_series_length(x):
    """
    Returns a factor which is 1 if all values in the time series occur only once,
    and below one if this is not the case.
    In principle, it just returns

        # unique values / # values

    :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.ratio_value_number_to_time_series_length(x)