@@ -307,7 +307,7 @@ def symmetry_looking(x, param):
307
307
:param param: contains dictionaries {"r": x} with x (float) is the percentage of the range to compare with
308
308
:type param: list
309
309
:return: the value of this feature
310
- :return type: bool
310
+ :return type: List[Tuple[str, bool]]
311
311
"""
312
312
if not isinstance (x , (np .ndarray , pd .Series )):
313
313
x = np .asarray (x )
@@ -413,7 +413,7 @@ def agg_autocorrelation(x, param):
413
413
autocorrelations. Further, n is an int and the maximal number of lags to consider.
414
414
:type param: list
415
415
:return: the value of this feature
416
- :return type: float
416
+ :return type: List[Tuple[str, float]]
417
417
"""
418
418
# if the time series is longer than the following threshold, we use fft to calculate the acf
419
419
THRESHOLD_TO_USE_FFT = 1250
@@ -468,7 +468,7 @@ def partial_autocorrelation(x, param):
468
468
:param param: contains dictionaries {"lag": val} with int val indicating the lag to be returned
469
469
:type param: list
470
470
:return: the value of this feature
471
- :return type: float
471
+ :return type: List[Tuple[str, float]]
472
472
"""
473
473
# Check the difference between demanded lags by param and possible lags to calculate (depends on len(x))
474
474
max_demanded_lag = max ([lag ["lag" ] for lag in param ])
@@ -510,7 +510,7 @@ def augmented_dickey_fuller(x, param):
510
510
statsmodels).
511
511
:type param: list
512
512
:return: the value of this feature
513
- :return type: float
513
+ :return type: List[Tuple[str, float]]
514
514
"""
515
515
516
516
@functools .lru_cache ()
@@ -1081,7 +1081,7 @@ def fft_coefficient(x, param):
1081
1081
"abs", "angle"]
1082
1082
:type param: list
1083
1083
:return: the different feature values
1084
- :return type: pandas.Series
1084
+ :return type: Iterator[Tuple[str, float]]
1085
1085
"""
1086
1086
1087
1087
assert (
@@ -1130,7 +1130,7 @@ def fft_aggregated(x, param):
1130
1130
"skew", "kurtosis"]
1131
1131
:type param: list
1132
1132
:return: the different feature values
1133
- :return type: pandas.Series
1133
+ :return type: Iterator[Tuple[str, float]]
1134
1134
"""
1135
1135
1136
1136
assert {config ["aggtype" ] for config in param } <= {
@@ -1282,7 +1282,7 @@ def index_mass_quantile(x, param):
1282
1282
:param param: contains dictionaries {"q": x} with x float
1283
1283
:type param: list
1284
1284
:return: the different feature values
1285
- :return type: pandas.Series
1285
+ :return type: List[Tuple[str, float]]
1286
1286
"""
1287
1287
1288
1288
x = np .asarray (x )
@@ -1341,7 +1341,7 @@ def linear_trend(x, param):
1341
1341
:param param: contains dictionaries {"attr": x} with x an string, the attribute name of the regression model
1342
1342
:type param: list
1343
1343
:return: the different feature values
1344
- :return type: pandas.Series
1344
+ :return type: List[Tuple[str, float]]
1345
1345
"""
1346
1346
# todo: we could use the index of the DataFrame here
1347
1347
linReg = linregress (range (len (x )), x )
@@ -1372,7 +1372,7 @@ def cwt_coefficients(x, param):
1372
1372
:param param: contains dictionaries {"widths":x, "coeff": y, "w": z} with x array of int and y,z int
1373
1373
:type param: list
1374
1374
:return: the different feature values
1375
- :return type: pandas.Series
1375
+ :return type: Iterator[Tuple[str, float]]
1376
1376
"""
1377
1377
1378
1378
calculated_cwt = {}
@@ -1413,7 +1413,7 @@ def spkt_welch_density(x, param):
1413
1413
:param param: contains dictionaries {"coeff": x} with x int
1414
1414
:type param: list
1415
1415
:return: the different feature values
1416
- :return type: pandas.Series
1416
+ :return type: Iterator[Tuple[str, float]]
1417
1417
"""
1418
1418
1419
1419
freq , pxx = welch (x , nperseg = min (len (x ), 256 ))
@@ -1458,7 +1458,7 @@ def ar_coefficient(x, param):
1458
1458
:param param: contains dictionaries {"coeff": x, "k": y} with x,y int
1459
1459
:type param: list
1460
1460
:return x: the different feature values
1461
- :return type: pandas.Series
1461
+ :return type: List[Tuple[str, float]]
1462
1462
"""
1463
1463
calculated_ar_params = {}
1464
1464
@@ -2087,7 +2087,7 @@ def friedrich_coefficients(x, param):
2087
2087
a positive integer corresponding to the returned coefficient
2088
2088
:type param: list
2089
2089
:return: the different feature values
2090
- :return type: pandas.Series
2090
+ :return type: List[Tuple[str, float]]
2091
2091
"""
2092
2092
# calculated is dictionary storing the calculated coefficients {m: {r: friedrich_coefficients}}
2093
2093
calculated = defaultdict (dict )
@@ -2171,7 +2171,7 @@ def agg_linear_trend(x, param):
2171
2171
:param param: contains dictionaries {"attr": x, "chunk_len": l, "f_agg": f} with x, f an string and l an int
2172
2172
:type param: list
2173
2173
:return: the different feature values
2174
- :return type: pandas.Series
2174
+ :return type: Iterator[Tuple[str, float]]
2175
2175
"""
2176
2176
# todo: we could use the index of the DataFrame here
2177
2177
@@ -2228,7 +2228,7 @@ def energy_ratio_by_chunks(x, param):
2228
2228
:type x: numpy.ndarray
2229
2229
:param param: contains dictionaries {"num_segments": N, "segment_focus": i} with N, i both ints
2230
2230
:return: the feature values
2231
- :return type: list of tuples (index, data)
2231
+ :return type: List[Tuple[str, float]]
2232
2232
"""
2233
2233
res_data = []
2234
2234
res_index = []
@@ -2275,7 +2275,7 @@ def linear_trend_timewise(x, param):
2275
2275
:param param: contains dictionaries {"attr": x} with x an string, the attribute name of the regression model
2276
2276
:type param: list
2277
2277
:return: the different feature values
2278
- :return type: list
2278
+ :return type: List[Tuple[str, float]]
2279
2279
"""
2280
2280
ix = x .index
2281
2281
@@ -2390,7 +2390,7 @@ def matrix_profile(x, param):
2390
2390
and decides which feature of the matrix profile to extract
2391
2391
:type param: list
2392
2392
:return: the different feature values
2393
- :return type: pandas.Series
2393
+ :return type: List[Tuple[str, float]]
2394
2394
"""
2395
2395
if mp is None :
2396
2396
raise ImportError (
@@ -2485,7 +2485,7 @@ def query_similarity_count(x, param):
2485
2485
`norm` (bool) to `False.
2486
2486
:type param: list
2487
2487
:return x: the different feature values
2488
- :return type: int
2488
+ :return type: List[Tuple[str, int | np.nan]]
2489
2489
"""
2490
2490
res = {}
2491
2491
T = np .asarray (x ).astype (float )
0 commit comments