Skip to main content

Feature Engineering and Large-scale Integration for Time Series

Project description

FELITS: Feature Engineering and Large-scale Integration for Time Series

License: MIT Python 3.11+

FELITS is an open-source Python library for end-to-end time series analysis and forecasting, with a focus on Short-Term Load Forecasting (STLF). It provides a complete pipeline: signal cleaning, feature engineering, feature selection, predictive modelling, and explainable AI (XAI).

The library is the result of the INIC01-6 research project (CONACYT, Paraguay) and was used to produce the methodology for a published research article.

Highlights

  • Preprocessing — outlier detection (IQR, Hampel/MAD, 3-sigma), STL decomposition, dual-scaler pattern
  • Feature extraction — cyclic encodings, lag/shift features, rolling statistics, FFT, wavelets, tsfresh, FATS-style
  • Feature selection — Granger causality, KSG mutual information, mRMR, Adaptive LASSO, RF/XGB importance
  • Models — XGBoost, RandomForest, LinearRegression, plus tf.keras RNN models (LSTM/GRU/BiLSTM/BiGRU) and Bahdanau attention variants
  • XAI — LIME, SHAP, and Deep SHAP as a closed-loop meta-optimizer for feature elimination
  • Optuna hyperparameter optimization with multi-objective TPE sampler
  • Dual API — all modules accept both pandas and polars DataFrames; internal logic uses polars for performance

Requirements

  • Python ≥3.11, <3.14 (TensorFlow requires ≤3.13)
  • uv (recommended) or pip

Installation

git clone https://github.com/felits/felits.git
cd felits

# Create venv and install with uv (recommended)
uv venv --python 3.13
uv pip install -e ".[all,dev]"

Extra dependency groups

Extra Includes
[dl] TensorFlow for RNN/Attention models
[xgb] XGBoost
[wavelet] PyWavelets
[duckdb] DuckDB for SQL-style batch feature engineering
[all] Everything above

Python version management

uv handles Python downloads automatically. To switch Python versions:

uv python install 3.13       # download Python 3.13
uv venv --python 3.13 .venv  # create a venv with it

Quickstart

import polars as pl
from felits.preprocessing import HampelFilter, TimeSeriesScaler
from felits.feature_extraction import cyclical_encode, rolling_statistics
from felits.feature_selection import FeatureSelector
from felits.models import XGBoostForecaster
from felits import Metrics

df = pl.read_csv("demand.csv", try_parse_dates=True)
df = df.with_columns(
    pl.Series("value_clean", HampelFilter(window_size=24).transform(df["value"]))
)
df = cyclical_encode(df, datetime_col="timestamp")
df = rolling_statistics(df, columns=["value_clean"], windows=[24, 168], stats=["mean", "std"])

model = XGBoostForecaster(n_estimators=500, max_depth=6)
model.fit(X_train, y_train)
preds = model.predict(X_test)

m = Metrics(y_test, preds)
print(m.dict_metrics())

Project layout

felits/
├── _compat.py               # pandas/polars compatibility layer
├── preprocessing/           # outliers, decomposition, scaling, imputation, metrics
├── feature_extraction/      # temporal, spectral, automated
├── feature_selection/       # causal, information, regularization, ensemble, xai
├── models/                  # base, sklearn, dl (separate modules)
│   ├── base.py              #   _SklearnForecaster, TF detection
│   ├── sklearn.py           #   XGBoost/RF/Linear wrappers
│   └── dl.py                #   RNN/Attention models (requires TF)
├── optimization.py          # Optuna wrappers
├── xai.py                   # LIME, SHAP, deep SHAP closed-loop
└── data.py                  # loaders and synthetic data
examples/                    # Runnable .py example scripts
notebooks/                   # Jupyter notebooks for each example
tests/                       # pytest suite (79+ tests)

Citation

If you use FELITS in academic work, please cite the associated research article (see research-docs/).

License

MIT — see LICENSE.

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

felits-0.1.0.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

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

felits-0.1.0-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: felits-0.1.0.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for felits-0.1.0.tar.gz
Algorithm Hash digest
SHA256 42de1f2d29487f0d71ee860c8290065d3f7c46063c47de3ca2597ee72c386013
MD5 3fc0d4b79ad99a30a0c47dd8f60481c6
BLAKE2b-256 0df452811ecd597c5aea06d5dc50f33ae5f146ee53177125162c2d4c2c346e8c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: felits-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 43.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for felits-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2dc23822fc47064145529a8029e7b4d3a5cac13bf5c84a1eab4251a0bd25a0d2
MD5 8c601d42e71529cdd472c58aea86148f
BLAKE2b-256 113ce412374f30f699583380ed247f124c8b5c1c206c95632275e8111d7b0df3

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