Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

predict-idlab/tsflex

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tsflex

PyPI Latest Release Conda Latest Release support-version codecov Code quality License: MIT Downloads PRs Welcome Documentation Testing

tsflex is a toolkit for flexible time series processing & feature extraction, making few assumptions about input data.

Useful links

Installation

If you are using pip, just execute the following command:

pip install tsflex

Or, if you are using conda, then execute this command:

conda install -c conda-forge tsflex

Why tsflex? ✨

  • flexible;
    • handles multivariate time series
    • versatile function support
      => integrates natively with many packages for processing (e.g., scipy.signal, statsmodels.tsa) & feature extraction (e.g., numpy, scipy.stats)
    • feature-extraction handles multiple strides & window sizes
  • efficient view-based operations
    => extremely low memory peak & fast execution times (see benchmarks)
  • maintains the time-index of the data
  • makes little to no assumptions about the time series data

Usage

tsflex is built to be intuitive, so we encourage you to copy-paste this code and toy with some parameters!

import pandas as pd; import scipy.stats as ssig; import numpy as np
from tsflex.features import FeatureDescriptor, FeatureCollection, NumpyFuncWrapper

# 1. -------- Get your time-indexed data --------
# Data contains 1 column; ["TMP"]
url = "https://github.com/predict-idlab/tsflex/raw/main/examples/data/empatica/tmp.parquet"
data = pd.read_parquet(url).set_index("timestamp")

# 2 -------- Construct your feature collection --------
fc = FeatureCollection(
    feature_descriptors=[
        FeatureDescriptor(
            function=NumpyFuncWrapper(func=ssig.skew, output_names="skew"),
            series_name="TMP", 
            window="5min",  # Use 5 minutes 
            stride="2.5min",  # With steps of 2.5 minutes
        )
    ]
)
# -- 2.1. Add features to your feature collection
fc.add(FeatureDescriptor(np.min, "TMP", '2.5min', '2.5min'))

# 3 -------- Calculate features --------
fc.calculate(data=data)

More examples

For processing look here
Other examples can be found here

Future work 🔨

  • scikit-learn integration for both processing and feature extraction
    note: is actively developed upon sklearn integration branch.
  • support for multi-indexed dataframes
  • random-strided rolling for data-augmention purposes.

Referencing our package

If you use tsflex in a scientific publication, we would highly appreciate citing us as:

@article{vanderdonckt2021tsflex,
    author = {Van Der Donckt, Jonas and Van Der Donckt, Jeroen and Deprost, Emiel and Van Hoecke, Sofie},
    title = {tsflex: flexible time series processing \& feature extraction},
    journal = {SoftwareX},
    year = {2021},
    url = {https://github.com/predict-idlab/tsflex},
    publisher={Elsevier}
}

👤 Jonas Van Der Donckt, Jeroen Van Der Donckt, Emiel Deprost

Sponsor this project

  •  
  •  

Packages

No packages published

Contributors 7

Morty Proxy This is a proxified and sanitized view of the page, visit original site.