Skip to main content

Toolkit for flexible operations on time-series data

Project description

tsflex

tsflex stands for: flexible time-series operations

It is a time-series first toolkit for processing & feature extraction, making few assumptions about input data.

Table of contents

Installation

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

pip install tsflex

Usage

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

Series processing

:WIP:

Feature extraction

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

# 1. -------- Get your time-indexed data --------
series_size = 10_000
series_name="lux"

data = pd.Series(
    data=np.random.random(series_size), 
    index=pd.date_range("2021-07-01", freq="1h", periods=series_size)
).rename(series_name)
# -- 1.1 drop some data, as we don't make frequency assumptions
data = data.drop(np.random.choice(data.index, 200, replace=False))


# 2 -------- Construct your feature collection --------
fc = FeatureCollection(
    feature_descriptors=[
        FeatureDescriptor(
            function=NumpyFuncWrapper(func=ss.skew, output_names="skew"),
            series_name=series_name, 
            window="1day", stride="6hours"
        )
    ]
)
# -- 2.1. Add multiple features to your feature collection
fc.add(FeatureDescriptor(np.min, series_name, '2days', '1day'))


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

Documentation

To see the documentation locally, install pdoc and execute the succeeding command from this folder location.

pdoc3 --template-dir docs/pdoc_template/ --http :8181 tsflex


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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsflex-0.1.1.1.tar.gz (31.5 kB view hashes)

Uploaded Source

Built Distribution

tsflex-0.1.1.1-py3-none-any.whl (42.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page