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
  • Pure pandas — built end-to-end on top of pandas, NumPy and scikit-learn

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 pandas as pd
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 = pd.read_csv("demand.csv", parse_dates=["timestamp"], index_col="timestamp")
df["value_clean"] = HampelFilter(window_size=24).transform(df["value"])
df = cyclical_encode(df)
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/
├── 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.3.0.tar.gz (37.7 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.3.0-py3-none-any.whl (48.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for felits-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3395687d36aeb4cc7fd6fc033270cbb660cd1c3efa966fcf57f28371a70678eb
MD5 861ed9f357b47d12d481208739939eb9
BLAKE2b-256 50cb4913241fe49a4c7e5edddba03df6d8ed17f00c33d0e21f48d9c1a50a80b5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: felits-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 48.3 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c4330a5ada542bdbae3a2a4b8d1589d142e43a1c6dae9b8921d386dcbd51504
MD5 045e18846cac70b70a7524009850b38e
BLAKE2b-256 d644d023b4043a5acbcb317a65028adf31fb0dc4f351e481a62d12832e2a0c6f

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