timeseries-features
A library for processing timeseries features over a dataframe of timeseries.
Dependencies :globe_with_meridians:
Python 3.11.6:
- pandas
- pyarrow
- statsmodels
- numpy
- sktime
- pytorch-forecasting
- mlflow
- litmodels
- dill
- cloudpickle
- torch
- pmdarima
Raison D'être :thought_balloon:
timeseries-features aims to process features relevant to predicting future values.
Architecture :triangular_ruler:
timeseries-features is a functional library, meaning that each phase of feature extraction gets put through a different function until the final output. It contains a feature extractor for auto-features, such as:
- Autocorrelation
- Partial Autocorrelation
- NBEATS Predictions
- ARIMA Predictions
To determine the auto-features it can use the following transforms:
- No-Op
- Velocity
- Log
- Acceleration
- Jerk
- Snap
- SMA 5
- Crackle
And a feature processor for the following features:
- Lags
- Rolling Count
- Rolling Sum
- Rolling Mean
- Rolling Median
- Rolling Variance
- Rolling Standard Deviation
- Rolling Minimum
- Rolling Maximum
- Rolling Skew
- Rolling Kurtosis
- Rolling Standard Error of the Mean
- Rolling Rank
- NBEATS Forecast
- ARIMA Forecast
Installation :inbox_tray:
This is a python package hosted on pypi, so to install simply run the following command:
pip install timeseriesfeatures
or install using this local repository:
python setup.py install --old-and-unmanageable
Usage example :eyes:
The use of timeseriesfeatures is entirely through code due to it being a library. It attempts to hide most of its complexity from the user, so it only has a few functions of relevance in its outward API.
Generating Features
To generate features:
import datetime
import pandas as pd
from timeseriesfeatures.process import compute
from timeseriesfeatures.process import process
from timeseriesfeatures.feature import Feature, FEATURE_TYPE_LAG, FEATURE_TYPE_ROLLING, VALUE_TYPE_NONE, VALUE_TYPE_DAYS
df = ... # Your timeseries dataframe
features = compute(df, max_lag=30)
features.extend([
Feature(feature_type=FEATURE_TYPE_LAG, value1=1),
Feature(feature_type=FEATURE_TYPE_LAG, value1=2),
Feature(feature_type=FEATURE_TYPE_LAG, value1=4),
Feature(feature_type=FEATURE_TYPE_LAG, value1=8),
Feature(feature_type=FEATURE_TYPE_ROLLING, value1=VALUE_TYPE_NONE, value2=None),
Feature(feature_type=FEATURE_TYPE_ROLLING, value1=VALUE_TYPE_DAYS, value2=30),
])
df = process(df, features=features)
This will produce a dataframe that contains the new timeseries related features.
License :memo:
The project is available under the MIT License.
Metadata
Release files for timeseriesfeatures 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| timeseriesfeatures-0.1.2.tar.gz | 13.0 kB | Without provenance | Details |
Release files / timeseriesfeatures-0.1.2.tar.gz
| Download URL | timeseriesfeatures-0.1.2.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e54ec5b742c31e8434cc21a4bcc824c57643d7084e2c6d2a9049807b4aaebdb
|
|
BLAKE2b-256 checksum How to use checksums |
8507d06c2f13463ee2c49d968559ca3e0f2174be41b0dec6f5d08e0920fc5933
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.6
|
Security for timeseriesfeatures 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.