Home

Awesome

Documentation Status license PyPI - Python Version !pypi Downloads Open In Colab Slack

Time Series Feature Extraction Library

<p align="center"> <a href="https://readthedocs.org/projects/tsfel/badge/?version=latest"><img src="https://raw.githubusercontent.com/fraunhoferportugal/tsfel/master/docs/imgs/tsfel_feature_sets.png" width="100%" alt="tsfel logo" /></a> </p>

Intuitive time series feature extraction

TSFEL is an open-source Python library for time series analysis. It centralizes a large and powerful feature set of several feature extraction methods from statistical, temporal, spectral, and fractal domains.

The documentation is available here.

You can install TSFEL via pip using the following:

pip install tsfel

A release on conda-forge is coming soon.

Getting started

Below is a quick example of how to use TSFEL for time series feature extraction:

import tsfel

# Loads a 10 s single lead ECG
data = tsfel.datasets.load_biopluxecg()

# Set up the default configuration using using the statistical, temporal and spectral feature sets. 
cfg = tsfel.get_features_by_domain()

# Extract features
X = tsfel.time_series_features_extractor(cfg, data)

For a more detailed walk-through — including input/output data formats, extraction routine configuration, and how to implement your custom features — refer to the documentation here.

Highlights

Available features

TSFEL automatically extracts more than 65 distinct features across statistical, temporal, spectral, and fractal domains.

Statistical domain

FeaturesComputational Cost
Absolute energy1
Average power1
ECDF1
ECDF Percentile1
ECDF Percentile Count1
Entropy1
Histogram1
Interquartile range1
Kurtosis1
Max1
Mean1
Mean absolute deviation1
Median1
Median absolute deviation1
Min1
Root mean square1
Skewness1
Standard deviation1
Variance1

Temporal domain

FeaturesComputational Cost
Area under the curve1
Autocorrelation2
Centroid1
Lempel-Ziv-Complexity*2
Mean absolute diff1
Mean diff1
Median absolute diff1
Median diff1
Negative turning points1
Peak to peak distance1
Positive turning points1
Signal distance1
Slope1
Sum absolute diff1
Zero crossing rate1
Neighbourhood peaks1

* Disabled by default due to its longer execution time compared to other features.

Spectral domain

FeaturesComputational Cost
FFT mean coefficient1
Fundamental frequency1
Human range energy1
LPCC1
MFCC1
Max power spectrum1
Maximum frequency1
Median frequency1
Power bandwidth1
Spectral centroid2
Spectral decrease1
Spectral distance1
Spectral entropy1
Spectral kurtosis2
Spectral positive turning points1
Spectral roll-off1
Spectral roll-on1
Spectral skewness2
Spectral slope1
Spectral spread2
Spectral variation1
Wavelet absolute mean2
Wavelet energy2
Wavelet standard deviation2
Wavelet entropy2
Wavelet variance2

Fractal domain

FeaturesComputational Cost
Detrended fluctuation analysis (DFA)3
Higuchi fractal dimension3
Hurst exponent3
Maximum fractal length3
Multiscale entropy (MSE)1
Petrosian fractal dimension1

Fractal domain features are typically applied to relatively longer signals to capture meaningful patterns, and it's usually unnecessary to previously divide the signal into shorter windows. Therefore, this domain is disabled in the default feature configuration files.

Support & General discussion

For bug reports, please use the GitHub issue tracker. To make feature requests, share ideas, engage in general discussions, or receive announcements, you're welcome to join our Slack community.

Citing

If you use TSFEL in your work, please cite the following publication:

Barandas, Marília and Folgado, Duarte, et al. "TSFEL: Time Series Feature Extraction Library." SoftwareX 11 ( 2020). https://doi.org/10.1016/j.softx.2020.100456

Acknowledgements

We gratefully acknowledge the financial support received from the Center for Responsible AI and the Total Integrated and Predictive Manufacturing System Platform for Industry 4.0 projects.