Skip to main content

Hardware-accelerated time series feature extraction using JAX

Project description

tsxtract

Hardware-accelerated time series feature extraction using JAX.

NOTE: tsxtract is still under development. Please report any bugs by creating an issue.

Please star the repository if you like tsxtract.

You can find the documentation here

Why tsxtract?

  • Fast: All extraction operations are vectorized
  • Hardware-accelerated: Run on CPU, GPU or TPU
  • Easy-to-use: One function is all you need

Example usage

from tsxtract.extraction import extract_features

# Dataset is a 3d-numpy or jax array with following dimensions:
# (samples, channels, length)
features = extract_features(dataset)

print(type(features)) # dict
print(features["mean"].shape) # jax.Array of size (samples, channels)

Check out main.py for a complete usage example.

Installation

Using uv

Step 1: Install uv: pip install uv

Step 2: Clone this repository: git clone https://github.com/ctseidler/tsxtract.git .

Step 3: Create a new virtual environment: uv venv --python 3.12

Step 4: Activate the virtual environment: source .venv/bin/activate

Step 5: Install the package as editable from source: uv pip install -e .

Step 6: Test your setup by executing the main.py script: uv run main.py

Overview of Extracted Features

  • Maximum
  • Mean
  • Minimum

Contributing

Contributions are welcome! Please open an issue, if you have any feature request. You can also implement it by forking the repository and creating a pull-request upon completion. Please make sure that your feature is covered by unittests (see test/). Current test coverage is 100%.

Development setup:

  • Install the package locally as mentioned above.
  • Run uv sync to install dev dependencies.
  • Run the unit tests prior to a commit (pre-commit): uv run coverage run -m pytest
  • Check the coverage report to identify missing test coverage: uv run coverage report -m

Roadmap

Version 0.2:

  • Test CPU and GPU support
  • Add example notebook for CPU and GPU extraction

Version 0.3:

  • Add additional features
  • Add features with customizable parameters
  • Add configuration options

Version 0.4:

  • Add support to custom features
  • Allow configuration as dict
  • Allow configuration as json

Version 0.5:

  • Add frequency-based features
  • Make package compatible for Python 3.10 and 3.11
  • Allow easy IO, e.g., by integrating polars

Version 1.0:

  • Performance benchmark
  • Add project logo

Authors

Christian T. Seidler

See also

  • tsfresh: Time Series Feature extraction based on scalable hypothesis test
  • TSFEL: Time Series Feature Extraction Library
  • pycatch22: CAnonical Time-series CHaracteristics in Python
  • seglearn: An sklearn extension for machine learning time series or sequences

License

MIT

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

tsxtract-0.1.0.tar.gz (15.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsxtract-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file tsxtract-0.1.0.tar.gz.

File metadata

  • Download URL: tsxtract-0.1.0.tar.gz
  • Upload date:
  • Size: 15.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.26

File hashes

Hashes for tsxtract-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6708b9a3a7dcb680cd34fd4934956082d5e0fd325fa07fcf76a638875d51b344
MD5 d9f1a3311e6af9ced2340c87bb93c43c
BLAKE2b-256 1195ba99bb95e3bc57119cd336202c5e94c6ea12e000c5828b7611d1b570c9b9

See more details on using hashes here.

File details

Details for the file tsxtract-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tsxtract-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.26

File hashes

Hashes for tsxtract-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38f361535d1d0fa3c7d45a9f7ada47b8d5cd32df1efcfff54562ea335b63ff97
MD5 f6695c8112ad0fc903e294272f60baa6
BLAKE2b-256 e291bdad25daa2c4fd84b261e38d1aa78ac9ea914a61f5480f56496a18780912

See more details on using hashes here.

Supported by

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