Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
As in tsfresh `percentage_of_reoccurring_datapoints_to_all_datapoints `_ \
Returns the percentage of unique values, that are present in the time series more than once.\
len(different values occurring more than once) / len(different values)\
This means the percentage is normalized to the number of unique values, in contrast to the \
percentage_of_reoccurring_values_to_all_values.
:param x: the time series to calculate the feature of
:type x: pandas.Series
:return: the value of this feature
:rtype: float
"""
_perc = feature_calculators.percentage_of_reoccurring_datapoints_to_all_datapoints(x)
logging.debug("percentage of reoccurring datapoints to all datapoints by tsfresh calculated")
return _perc
def time_series_percentage_of_reoccurring_datapoints_to_all_datapoints(x):
"""
Returns the percentage of unique values, that are present in the time series
more than once.
len(different values occurring more than once) / len(different values)
This means the percentage is normalized to the number of unique values,
in contrast to the percentage_of_reoccurring_values_to_all_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.percentage_of_reoccurring_datapoints_to_all_datapoints(x)
def get_function(self):
return percentage_of_reoccurring_datapoints_to_all_datapoints