Skip to main content

Zero-config time series forecasting & analysis library. Pure numpy + scipy implementation with 30+ models, regression, and adaptive intelligence.

Project description


Vectrix

Feed data. Get forecasts. Zero config.

Pure Python time series forecasting -- 30+ models, zero heavy dependencies.


PyPI Python License Tests Sponsor


Installation · Quick Start · Features · API · 한국어


  3 dependencies    30+ models    1 line of code
  ─────────────     ──────────    ──────────────
  numpy             AutoETS       from vectrix import forecast
  scipy             AutoARIMA     result = forecast(data, steps=12)
  pandas            Theta/DOT     print(result)
                    TBATS
                    GARCH
                    ...

Quick Start

pip install vectrix
from vectrix import forecast

result = forecast("sales.csv", steps=12)
print(result)
result.plot()
result.to_csv("output.csv")

One call. Auto model selection, flat-line prevention, confidence intervals, and a plot.


Why Vectrix?

Vectrix statsforecast Prophet Darts
Zero-config auto-forecast Yes Yes -- --
Pure Python (no heavy deps) Yes -- -- --
30+ models built-in Yes Yes -- Yes
Flat prediction defense Yes -- -- --
Adversarial stress testing Yes -- -- --
Forecast DNA fingerprinting Yes -- -- --
Business constraints (8 types) Yes -- -- --
R-style regression Yes -- -- --

numpy + scipy + pandas -- that's the entire install.


Features

Core Models
Model Description
AutoETS 30 Error x Trend x Seasonal combinations, AICc selection
AutoARIMA Seasonal ARIMA, stepwise order selection
Theta / DOT Original Theta + Dynamic Optimized Theta
AutoCES Complex Exponential Smoothing (Svetunkov 2023)
AutoTBATS Trigonometric multi-seasonal decomposition
GARCH GARCH, EGARCH, GJR-GARCH volatility models
Croston Classic, SBA, TSB for intermittent demand
Logistic Growth Saturating trends with capacity constraints
AutoMSTL Multi-seasonal decomposition + ARIMA residuals
Baselines Naive, Seasonal Naive, Mean, Drift, Window Average
Novel Methods
Method Description
Lotka-Volterra Ensemble Ecological competition dynamics for model weighting
Phase Transition Critical slowing down for regime shift prediction
Adversarial Stress 5 perturbation operators for robustness analysis
Hawkes Demand Self-exciting point process for clustered demand
Entropic Confidence Shannon entropy uncertainty quantification
Adaptive Intelligence
Feature Description
Regime Detection Pure numpy HMM (Baum-Welch + Viterbi)
Self-Healing CUSUM + EWMA drift detection, conformal correction
Constraints 8 types: non-negative, range, capacity, YoY, sum, monotone, ratio, custom
Forecast DNA 65+ feature fingerprinting, meta-learning recommendation
Flat Defense 4-level prevention system
Regression & Diagnostics
Feature Description
Methods OLS, Ridge, Lasso, Huber, Quantile
Formula R-style regress(data=df, formula="y ~ x1 + x2")
Diagnostics Durbin-Watson, Breusch-Pagan, VIF, normality
Variable Selection Stepwise, regularization CV, best subset
Time Series Newey-West, Cochrane-Orcutt, Granger causality
Business Intelligence
Feature Description
Anomaly Detection Automated outlier identification and explanation
What-if Analysis Scenario-based forecast simulation
Backtesting Rolling origin cross-validation
Hierarchy Bottom-up, top-down, MinTrace reconciliation
Intervals Conformal + bootstrap prediction intervals

Installation

pip install vectrix                # Core (numpy + scipy + pandas)
pip install "vectrix[numba]"       # + Numba JIT (2-5x speedup)
pip install "vectrix[ml]"          # + LightGBM, XGBoost, scikit-learn
pip install "vectrix[all]"         # Everything

Requirements: Python 3.10+


Usage Examples

Easy API

from vectrix import forecast, analyze, regress

result = forecast([100, 120, 115, 130, 125, 140], steps=5)

report = analyze(df, date="date", value="sales")
print(f"Difficulty: {report.dna.difficulty}")

model = regress(data=df, formula="sales ~ temperature + promotion")
print(model.summary())

DataFrame Workflow

from vectrix import forecast, analyze
import pandas as pd

df = pd.read_csv("data.csv")

report = analyze(df, date="date", value="sales")
print(report.summary())

result = forecast(df, date="date", value="sales", steps=30)
result.plot()
result.to_csv("forecast.csv")

Direct Engine Access

from vectrix.engine import AutoETS, AutoARIMA
from vectrix.adaptive import ForecastDNA

ets = AutoETS(period=7)
ets.fit(data)
pred, lower, upper = ets.predict(30)

dna = ForecastDNA()
profile = dna.analyze(data, period=7)
print(f"Difficulty: {profile.difficulty}")
print(f"Recommended: {profile.recommendedModels}")

Business Constraints

from vectrix.adaptive import ConstraintAwareForecaster, Constraint

caf = ConstraintAwareForecaster()
result = caf.apply(predictions, lower95, upper95, constraints=[
    Constraint('non_negative', {}),
    Constraint('range', {'min': 100, 'max': 5000}),
    Constraint('capacity', {'capacity': 10000}),
    Constraint('yoy_change', {'maxPct': 30, 'historicalData': past_year}),
])

Classic API

from vectrix import Vectrix

fx = Vectrix(verbose=True)
result = fx.forecast(df, dateCol="date", valueCol="sales", steps=30)

if result.success:
    print(f"Model: {result.bestModelName}")
    print(f"Predictions: {result.predictions}")

API Reference

Easy API (Recommended)

Function Description
forecast(data, steps=30) Auto model selection forecasting
analyze(data) DNA profiling, changepoints, anomalies
regress(y, X) / regress(data=df, formula="y ~ x") Regression with diagnostics
quick_report(data, steps=30) Combined analysis + forecast

Classic API

Method Description
Vectrix().forecast(df, dateCol, valueCol, steps) Full pipeline
Vectrix().analyze(df, dateCol, valueCol) Data analysis

Return Objects

Object Key Attributes
EasyForecastResult .predictions .dates .lower .upper .model .plot() .to_csv() .to_json()
EasyAnalysisResult .dna .changepoints .anomalies .features .summary()
EasyRegressionResult .coefficients .pvalues .r_squared .f_stat .summary() .diagnose()

Architecture

vectrix/
├── easy.py               forecast(), analyze(), regress()
├── vectrix.py             Vectrix class (full pipeline)
├── types.py               ForecastResult, DataCharacteristics
├── engine/                30+ statistical models
│   ├── ets.py               AutoETS (30 combinations)
│   ├── arima.py             AutoARIMA (AICc stepwise)
│   ├── theta.py             Theta method
│   ├── dot.py               Dynamic Optimized Theta
│   ├── ces.py               Complex Exponential Smoothing
│   ├── tbats.py             TBATS / AutoTBATS
│   ├── mstl.py              Multi-Seasonal Decomposition
│   ├── garch.py             GARCH / EGARCH / GJR-GARCH
│   ├── croston.py           Croston Classic / SBA / TSB
│   ├── logistic.py          Logistic Growth
│   ├── hawkes.py            Hawkes Intermittent Demand
│   ├── lotkaVolterra.py     Lotka-Volterra Ensemble
│   ├── phaseTransition.py   Phase Transition Forecaster
│   ├── adversarial.py       Adversarial Stress Tester
│   ├── entropic.py          Entropic Confidence Scorer
│   └── turbo.py             Numba JIT acceleration
├── adaptive/              Regime, self-healing, constraints, DNA
├── regression/            OLS, Ridge, Lasso, Huber, Quantile
├── business/              Anomaly, backtest, what-if, metrics
├── flat_defense/          4-level flat prediction prevention
├── hierarchy/             Bottom-up, top-down, MinTrace
├── intervals/             Conformal + bootstrap intervals
├── ml/                    LightGBM, XGBoost wrappers
└── global_model/          Cross-series forecasting

Contributing

git clone https://github.com/eddmpython/vectrix.git
cd vectrix
uv sync --extra dev
uv run pytest

Support

If you find Vectrix useful, consider supporting the project:

Buy Me a Coffee

License

MIT -- Use freely in personal and commercial projects.

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

vectrix-0.0.1.tar.gz (257.0 kB view details)

Uploaded Source

Built Distribution

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

vectrix-0.0.1-py3-none-any.whl (290.6 kB view details)

Uploaded Python 3

File details

Details for the file vectrix-0.0.1.tar.gz.

File metadata

  • Download URL: vectrix-0.0.1.tar.gz
  • Upload date:
  • Size: 257.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vectrix-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f192f99b63bb5d1826ea788b7ae55ce608285355ffa4786f6b8a17d9921fa096
MD5 82c4d8b599d85b68a091019538cbeb42
BLAKE2b-256 0a4c23b1a69d7e6e0ac8978fcd79337f80c61112f025836ccebcfe5e1b243453

See more details on using hashes here.

Provenance

The following attestation bundles were made for vectrix-0.0.1.tar.gz:

Publisher: publish.yml on eddmpython/vectrix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vectrix-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: vectrix-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 290.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vectrix-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef3969a3824b5152ce0f7599d44361dc46ce1512af793485c04cd35c56102901
MD5 469946dc918061a7f53003e16fabb07e
BLAKE2b-256 2aeb1fc3c4b0b212e906abb583173c9f24d1de7ed785cbf34bddef9745892f58

See more details on using hashes here.

Provenance

The following attestation bundles were made for vectrix-0.0.1-py3-none-any.whl:

Publisher: publish.yml on eddmpython/vectrix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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