def feature_extract(dt):
    
    import tsfresh.feature_extraction.feature_calculators as fc
    
    ft = {
        'abs_energy': fc.abs_energy(dt),
        'sum_values': fc.sum_values(dt),
        'mean': fc.mean(dt),
        'maximum': fc.maximum(dt),
        'minimum': fc.minimum(dt),
        'median': fc.median(dt),
        'quantile_0.1': fc.quantile(dt, 0.1),
        'quantile_0.2': fc.quantile(dt, 0.2),
        'quantile_0.3': fc.quantile(dt, 0.3),
        'quantile_0.4': fc.quantile(dt, 0.4),
        'quantile_0.5': fc.quantile(dt, 0.5),
        'quantile_0.6': fc.quantile(dt, 0.6),
        'quantile_0.7': fc.quantile(dt, 0.7),
        'quantile_0.8': fc.quantile(dt, 0.8),
        'quantile_0.9': fc.quantile(dt, 0.9),
        #
        # TODO:
        # Below functions dont works well -> need to be checked!!
        #
        #'fft_coefficient__coeff_0__attr_real': fc.fft_coefficient(dt {"coeff": 0, "attr": "real"}),
        #'fft_coefficient__coeff_0__attr_imag': fc.fft_coefficient(dt {"coeff": 0, "attr": "imag"}),
        #'fft_coefficient__coeff_0__attr_abs': fc.fft_coefficient(dt {"coeff": 0, "attr": "abs"}),
        #'fft_coefficient__coeff_0__attr_angle': fc.fft_coefficient(dt {"coeff": 0, "attr": "angle"}),
        #
        #=> Mr. Huy just fix this issue with above function fft_ft !!
    }
    
    ft.update(fft_ft(dt))
    
    return ft
Beispiel #2
0
def sum_values(mag):
    """Sums over all mag values.

    rtype: float
    """
    val = ts.sum_values(mag)
    return val
Beispiel #3
0
def time_series_sum_values(x):
    """
    :param x: the time series to calculate the feature of
    :type x: pandas.Series
    :return: the value of this feature
    :return type: bool
    """
    return ts_feature_calculators.sum_values(x)
def TS_features12(signal):
    stand_deviation = ts.standard_deviation(signal)
    sum_reoccurring = ts.sum_of_reoccurring_data_points(signal)
    sum_r_value = ts.sum_of_reoccurring_values(signal)
    sum_v = ts.sum_values(signal)
    variance = ts.variance(signal)
    variance_larger_than_sd = ts.variance_larger_than_standard_deviation(
        signal)
    return stand_deviation, sum_reoccurring, sum_r_value, sum_v, variance, variance_larger_than_sd