vectrix 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. vectrix-0.0.1/.github/FUNDING.yml +1 -0
  2. vectrix-0.0.1/.github/workflows/publish.yml +62 -0
  3. vectrix-0.0.1/.github/workflows/test.yml +35 -0
  4. vectrix-0.0.1/.gitignore +62 -0
  5. vectrix-0.0.1/.python-version +1 -0
  6. vectrix-0.0.1/CHANGELOG.md +71 -0
  7. vectrix-0.0.1/LICENSE +21 -0
  8. vectrix-0.0.1/PKG-INFO +377 -0
  9. vectrix-0.0.1/README.md +327 -0
  10. vectrix-0.0.1/README_KR.md +265 -0
  11. vectrix-0.0.1/pyproject.toml +83 -0
  12. vectrix-0.0.1/src/vectrix/__init__.py +87 -0
  13. vectrix-0.0.1/src/vectrix/adaptive/__init__.py +74 -0
  14. vectrix-0.0.1/src/vectrix/adaptive/constraints.py +824 -0
  15. vectrix-0.0.1/src/vectrix/adaptive/dna.py +1644 -0
  16. vectrix-0.0.1/src/vectrix/adaptive/healing.py +886 -0
  17. vectrix-0.0.1/src/vectrix/adaptive/regime.py +1243 -0
  18. vectrix-0.0.1/src/vectrix/analyzer/__init__.py +7 -0
  19. vectrix-0.0.1/src/vectrix/analyzer/autoAnalyzer.py +416 -0
  20. vectrix-0.0.1/src/vectrix/batch.py +147 -0
  21. vectrix-0.0.1/src/vectrix/business/__init__.py +29 -0
  22. vectrix-0.0.1/src/vectrix/business/anomaly.py +204 -0
  23. vectrix-0.0.1/src/vectrix/business/backtest.py +176 -0
  24. vectrix-0.0.1/src/vectrix/business/explain.py +182 -0
  25. vectrix-0.0.1/src/vectrix/business/htmlReport.py +170 -0
  26. vectrix-0.0.1/src/vectrix/business/metrics.py +160 -0
  27. vectrix-0.0.1/src/vectrix/business/report.py +259 -0
  28. vectrix-0.0.1/src/vectrix/business/whatif.py +161 -0
  29. vectrix-0.0.1/src/vectrix/easy.py +1257 -0
  30. vectrix-0.0.1/src/vectrix/engine/__init__.py +80 -0
  31. vectrix-0.0.1/src/vectrix/engine/adversarial.py +424 -0
  32. vectrix-0.0.1/src/vectrix/engine/arima.py +888 -0
  33. vectrix-0.0.1/src/vectrix/engine/arimax.py +136 -0
  34. vectrix-0.0.1/src/vectrix/engine/baselines.py +211 -0
  35. vectrix-0.0.1/src/vectrix/engine/ces.py +213 -0
  36. vectrix-0.0.1/src/vectrix/engine/changepoint.py +679 -0
  37. vectrix-0.0.1/src/vectrix/engine/comparison.py +418 -0
  38. vectrix-0.0.1/src/vectrix/engine/crossval.py +191 -0
  39. vectrix-0.0.1/src/vectrix/engine/croston.py +223 -0
  40. vectrix-0.0.1/src/vectrix/engine/decomposition.py +427 -0
  41. vectrix-0.0.1/src/vectrix/engine/diagnostics.py +512 -0
  42. vectrix-0.0.1/src/vectrix/engine/dot.py +142 -0
  43. vectrix-0.0.1/src/vectrix/engine/entropic.py +380 -0
  44. vectrix-0.0.1/src/vectrix/engine/ets.py +750 -0
  45. vectrix-0.0.1/src/vectrix/engine/events.py +599 -0
  46. vectrix-0.0.1/src/vectrix/engine/garch.py +368 -0
  47. vectrix-0.0.1/src/vectrix/engine/hawkes.py +302 -0
  48. vectrix-0.0.1/src/vectrix/engine/impute.py +215 -0
  49. vectrix-0.0.1/src/vectrix/engine/logistic.py +280 -0
  50. vectrix-0.0.1/src/vectrix/engine/lotkaVolterra.py +283 -0
  51. vectrix-0.0.1/src/vectrix/engine/mstl.py +330 -0
  52. vectrix-0.0.1/src/vectrix/engine/periodic_drop.py +194 -0
  53. vectrix-0.0.1/src/vectrix/engine/phaseTransition.py +220 -0
  54. vectrix-0.0.1/src/vectrix/engine/probabilistic.py +176 -0
  55. vectrix-0.0.1/src/vectrix/engine/tbats.py +333 -0
  56. vectrix-0.0.1/src/vectrix/engine/theta.py +311 -0
  57. vectrix-0.0.1/src/vectrix/engine/tsfeatures.py +1321 -0
  58. vectrix-0.0.1/src/vectrix/engine/turbo.py +466 -0
  59. vectrix-0.0.1/src/vectrix/experiments/__init__.py +5 -0
  60. vectrix-0.0.1/src/vectrix/experiments/e001_realdata_benchmark.py +421 -0
  61. vectrix-0.0.1/src/vectrix/experiments/e002_ets_optimization.py +335 -0
  62. vectrix-0.0.1/src/vectrix/experiments/e003_speed_optimization.py +312 -0
  63. vectrix-0.0.1/src/vectrix/experiments/e004_speed_improvement.py +87 -0
  64. vectrix-0.0.1/src/vectrix/experiments/e005_ensemble_optimization.py +528 -0
  65. vectrix-0.0.1/src/vectrix/experiments/e006_multiple_seasonality.py +501 -0
  66. vectrix-0.0.1/src/vectrix/experiments/e007_outlier_handling.py +563 -0
  67. vectrix-0.0.1/src/vectrix/experiments/e009_periodic_pattern.py +411 -0
  68. vectrix-0.0.1/src/vectrix/experiments/e010_mstl_loess.py +436 -0
  69. vectrix-0.0.1/src/vectrix/experiments/e011_drop_detection_integration.py +338 -0
  70. vectrix-0.0.1/src/vectrix/flat_defense/__init__.py +19 -0
  71. vectrix-0.0.1/src/vectrix/flat_defense/corrector.py +302 -0
  72. vectrix-0.0.1/src/vectrix/flat_defense/detector.py +187 -0
  73. vectrix-0.0.1/src/vectrix/flat_defense/diagnostic.py +274 -0
  74. vectrix-0.0.1/src/vectrix/global_model/__init__.py +15 -0
  75. vectrix-0.0.1/src/vectrix/global_model/global_forecaster.py +148 -0
  76. vectrix-0.0.1/src/vectrix/global_model/panel.py +144 -0
  77. vectrix-0.0.1/src/vectrix/hierarchy/__init__.py +16 -0
  78. vectrix-0.0.1/src/vectrix/hierarchy/reconciliation.py +227 -0
  79. vectrix-0.0.1/src/vectrix/intervals/__init__.py +14 -0
  80. vectrix-0.0.1/src/vectrix/intervals/bootstrap.py +97 -0
  81. vectrix-0.0.1/src/vectrix/intervals/conformal.py +164 -0
  82. vectrix-0.0.1/src/vectrix/ml/__init__.py +19 -0
  83. vectrix-0.0.1/src/vectrix/ml/lightgbm_model.py +114 -0
  84. vectrix-0.0.1/src/vectrix/ml/sklearn_model.py +101 -0
  85. vectrix-0.0.1/src/vectrix/ml/xgboost_model.py +113 -0
  86. vectrix-0.0.1/src/vectrix/models/__init__.py +7 -0
  87. vectrix-0.0.1/src/vectrix/models/ensemble/__init__.py +7 -0
  88. vectrix-0.0.1/src/vectrix/models/ensemble/variabilityEnsemble.py +343 -0
  89. vectrix-0.0.1/src/vectrix/models/selector.py +228 -0
  90. vectrix-0.0.1/src/vectrix/persistence.py +99 -0
  91. vectrix-0.0.1/src/vectrix/py.typed +0 -0
  92. vectrix-0.0.1/src/vectrix/regression/__init__.py +99 -0
  93. vectrix-0.0.1/src/vectrix/regression/diagnostics.py +903 -0
  94. vectrix-0.0.1/src/vectrix/regression/features.py +234 -0
  95. vectrix-0.0.1/src/vectrix/regression/inference.py +532 -0
  96. vectrix-0.0.1/src/vectrix/regression/linear.py +230 -0
  97. vectrix-0.0.1/src/vectrix/regression/reduction.py +193 -0
  98. vectrix-0.0.1/src/vectrix/regression/robust.py +581 -0
  99. vectrix-0.0.1/src/vectrix/regression/selection.py +870 -0
  100. vectrix-0.0.1/src/vectrix/regression/timeseries_regression.py +940 -0
  101. vectrix-0.0.1/src/vectrix/tsframe/__init__.py +13 -0
  102. vectrix-0.0.1/src/vectrix/tsframe/tsframe.py +296 -0
  103. vectrix-0.0.1/src/vectrix/types.py +338 -0
  104. vectrix-0.0.1/src/vectrix/vectrix.py +837 -0
  105. vectrix-0.0.1/tests/__init__.py +0 -0
  106. vectrix-0.0.1/tests/conftest.py +120 -0
  107. vectrix-0.0.1/tests/test_adaptive.py +312 -0
  108. vectrix-0.0.1/tests/test_all_models.py +118 -0
  109. vectrix-0.0.1/tests/test_core_fixes.py +175 -0
  110. vectrix-0.0.1/tests/test_easy.py +413 -0
  111. vectrix-0.0.1/tests/test_engine_extras.py +279 -0
  112. vectrix-0.0.1/tests/test_forecastx.py +105 -0
  113. vectrix-0.0.1/tests/test_novel.py +237 -0
  114. vectrix-0.0.1/tests/test_regression.py +363 -0
  115. vectrix-0.0.1/tests/test_worldclass.py +247 -0
@@ -0,0 +1 @@
1
+ buy_me_a_coffee: eddmpython
@@ -0,0 +1,62 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Set up Python ${{ matrix.python-version }}
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: ${{ matrix.python-version }}
22
+
23
+ - name: Install dependencies
24
+ run: |
25
+ python -m pip install --upgrade pip
26
+ pip install -e ".[dev]"
27
+
28
+ - name: Run tests
29
+ run: pytest tests/ -v --tb=short
30
+
31
+ publish:
32
+ needs: test
33
+ runs-on: ubuntu-latest
34
+ environment: pypi
35
+ permissions:
36
+ id-token: write
37
+ contents: write
38
+
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+
42
+ - name: Set up Python
43
+ uses: actions/setup-python@v5
44
+ with:
45
+ python-version: "3.12"
46
+
47
+ - name: Install build tools
48
+ run: |
49
+ python -m pip install --upgrade pip
50
+ pip install build
51
+
52
+ - name: Build package
53
+ run: python -m build
54
+
55
+ - name: Publish to PyPI
56
+ uses: pypa/gh-action-pypi-publish@release/v1
57
+
58
+ - name: Create GitHub Release
59
+ uses: softprops/action-gh-release@v2
60
+ with:
61
+ generate_release_notes: true
62
+ files: dist/*
@@ -0,0 +1,35 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, windows-latest]
16
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install -e ".[dev]"
30
+
31
+ - name: Lint with ruff
32
+ run: ruff check src/vectrix
33
+
34
+ - name: Run tests
35
+ run: pytest tests/ -v --tb=short
@@ -0,0 +1,62 @@
1
+ # Python
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.pyd
6
+ *.egg-info/
7
+ *.egg
8
+ dist/
9
+ build/
10
+ *.whl
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ env/
15
+ venv/
16
+ CLAUDE.md
17
+
18
+ # IDE
19
+ .vscode/
20
+ .idea/
21
+ *.swp
22
+ *.swo
23
+ *~
24
+
25
+ # OS
26
+ .DS_Store
27
+ Thumbs.db
28
+
29
+ # Environment
30
+ .env
31
+ .env.*
32
+
33
+ # Data files
34
+ *.xlsx
35
+ *.xls
36
+ *.csv
37
+ *.tsv
38
+ *.pkl
39
+ *.pickle
40
+ *.parquet
41
+ *.feather
42
+ *.jsonl
43
+
44
+ # Output files
45
+ *.log
46
+ *.html
47
+ *.pdf
48
+
49
+ # Cache
50
+ .cache/
51
+ .pytest_cache/
52
+ .mypy_cache/
53
+ .ruff_cache/
54
+ htmlcov/
55
+ coverage.xml
56
+ .coverage
57
+
58
+ # Jupyter
59
+ .ipynb_checkpoints/
60
+
61
+ # uv
62
+ uv.lock
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,71 @@
1
+ # Changelog
2
+
3
+ All notable changes to Vectrix will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.0.1] - 2026-02-27
9
+
10
+ Initial public release of Vectrix -- a zero-config time series forecasting library built with pure NumPy + SciPy.
11
+
12
+ ### Added
13
+
14
+ **Core Forecasting Engine (30+ Models)**
15
+ - AutoETS: 30 Error x Trend x Seasonal combinations with AICc model selection (Hyndman-Khandakar stepwise algorithm)
16
+ - AutoARIMA: Seasonal ARIMA with stepwise order selection, CSS objective function
17
+ - Theta / Dynamic Optimized Theta (DOT): Original Theta method + M3 Competition winner methodology
18
+ - AutoCES: Complex Exponential Smoothing (Svetunkov 2023)
19
+ - AutoTBATS: Trigonometric seasonality for complex multi-seasonal time series
20
+ - GARCH / EGARCH / GJR-GARCH: Conditional volatility modeling with asymmetric effects
21
+ - Croston Classic / SBA / TSB / AutoCroston: Intermittent and lumpy demand forecasting
22
+ - Logistic Growth: Prophet-style saturating trends with user-defined capacity constraints
23
+ - AutoMSTL: Multi-seasonal STL decomposition with ARIMA residual forecasting
24
+ - Baseline models: Naive, Seasonal Naive, Mean, Random Walk with Drift, Window Average
25
+
26
+ **Novel Methods**
27
+ - Lotka-Volterra Ensemble: Ecological competition dynamics for adaptive model weighting
28
+ - Phase Transition Forecaster: Critical slowing down detection for regime shift prediction
29
+ - Adversarial Stress Tester: 5 perturbation operators (spike, dropout, drift, noise, swap) for forecast robustness analysis
30
+ - Hawkes Intermittent Demand: Self-exciting point process for clustered demand patterns
31
+ - Entropic Confidence Scorer: Shannon entropy-based forecast uncertainty quantification
32
+
33
+ **Adaptive Intelligence**
34
+ - Regime Detection: Pure numpy Hidden Markov Model implementation (Baum-Welch + Viterbi)
35
+ - Self-Healing Forecast: CUSUM + EWMA drift detection with conformal prediction correction
36
+ - Constraint-Aware Forecasting: 8 business constraint types (non-negative, range, capacity, YoY change, sum, monotone, ratio, custom)
37
+ - Forecast DNA: 65+ time series feature fingerprinting with meta-learning model recommendation and similarity search
38
+ - Flat Defense: 4-level system (diagnostic, detection, correction, prevention) against flat prediction failure
39
+
40
+ **Easy API**
41
+ - `forecast()`: One-call forecasting with automatic model selection, accepts str/DataFrame/Series/ndarray/list/tuple/dict
42
+ - `analyze()`: Time series DNA profiling, changepoint detection, anomaly identification
43
+ - `regress()`: R-style formula regression (`y ~ x1 + x2`) with full diagnostics
44
+ - `quick_report()`: Combined analysis + forecast report generation
45
+ - Rich result objects with `.plot()`, `.to_csv()`, `.to_json()`, `.to_dataframe()`, `.summary()`, `.describe()`
46
+
47
+ **Regression & Diagnostics**
48
+ - 5 regression methods: OLS, Ridge, Lasso, Huber, Quantile
49
+ - R-style formula interface: `regress(data=df, formula="sales ~ ads + price")`
50
+ - Full diagnostics suite: Durbin-Watson, Breusch-Pagan, VIF, Jarque-Bera normality tests
51
+ - Variable selection: Stepwise (forward/backward), regularization CV, best subset
52
+ - Time series regression: Newey-West HAC, Cochrane-Orcutt, Prais-Winsten, Granger causality
53
+
54
+ **Business Intelligence**
55
+ - Anomaly detection with automated outlier identification and natural language explanation
56
+ - What-if analysis: Scenario-based forecast simulation with parameter perturbation
57
+ - Backtesting: Rolling origin cross-validation with MAE, RMSE, MAPE, SMAPE metrics
58
+ - Hierarchy reconciliation: Bottom-up, Top-down, MinTrace optimal (Wickramasuriya 2019)
59
+ - Prediction intervals: Conformal prediction + Bootstrap methods
60
+
61
+ **Infrastructure**
62
+ - Batch forecasting API with ThreadPoolExecutor parallelization
63
+ - Model persistence: `.fxm` binary format with save/load/info utilities
64
+ - TSFrame: Time series DataFrame wrapper with frequency detection
65
+ - Global model: Cross-series learning for related time series
66
+ - Numba JIT acceleration for core computations (optional dependency)
67
+ - 275 tests covering all models, edge cases, and integration scenarios
68
+ - GitHub Actions CI: Matrix testing (Python 3.10-3.13, Ubuntu + Windows)
69
+ - PyPI trusted publisher deployment via GitHub Actions
70
+
71
+ [0.0.1]: https://github.com/eddmpython/vectrix/releases/tag/v0.0.1
vectrix-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Vectrix Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
vectrix-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,377 @@
1
+ Metadata-Version: 2.4
2
+ Name: vectrix
3
+ Version: 0.0.1
4
+ Summary: Zero-config time series forecasting & analysis library. Pure numpy + scipy implementation with 30+ models, regression, and adaptive intelligence.
5
+ Project-URL: Homepage, https://github.com/eddmpython/vectrix
6
+ Project-URL: Repository, https://github.com/eddmpython/vectrix
7
+ Project-URL: Issues, https://github.com/eddmpython/vectrix/issues
8
+ Project-URL: Buy Me a Coffee, https://buymeacoffee.com/eddmpython
9
+ Author: eddmpython
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: arima,auto-forecast,ets,exponential-smoothing,forecasting,mstl,numpy,prediction,regression,theta,time-series
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Scientific/Engineering
24
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
25
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
26
+ Classifier: Typing :: Typed
27
+ Requires-Python: >=3.10
28
+ Requires-Dist: numpy>=1.24.0
29
+ Requires-Dist: pandas>=2.0.0
30
+ Requires-Dist: scipy>=1.10.0
31
+ Provides-Extra: all
32
+ Requires-Dist: lightgbm>=3.0; extra == 'all'
33
+ Requires-Dist: numba>=0.58.0; extra == 'all'
34
+ Requires-Dist: pytest-cov>=4.0; extra == 'all'
35
+ Requires-Dist: pytest>=7.0; extra == 'all'
36
+ Requires-Dist: ruff>=0.1.0; extra == 'all'
37
+ Requires-Dist: scikit-learn>=1.0; extra == 'all'
38
+ Requires-Dist: xgboost>=1.7; extra == 'all'
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
41
+ Requires-Dist: pytest>=7.0; extra == 'dev'
42
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
43
+ Provides-Extra: ml
44
+ Requires-Dist: lightgbm>=3.0; extra == 'ml'
45
+ Requires-Dist: scikit-learn>=1.0; extra == 'ml'
46
+ Requires-Dist: xgboost>=1.7; extra == 'ml'
47
+ Provides-Extra: numba
48
+ Requires-Dist: numba>=0.58.0; extra == 'numba'
49
+ Description-Content-Type: text/markdown
50
+
51
+ <div align="center">
52
+
53
+ <br>
54
+
55
+ # Vectrix
56
+
57
+ **Feed data. Get forecasts. Zero config.**
58
+
59
+ Pure Python time series forecasting -- 30+ models, zero heavy dependencies.
60
+
61
+ <br>
62
+
63
+ [![PyPI](https://img.shields.io/pypi/v/vectrix?style=flat-square&color=6366f1&label=PyPI)](https://pypi.org/project/vectrix/)
64
+ [![Python](https://img.shields.io/pypi/pyversions/vectrix?style=flat-square&label=Python)](https://pypi.org/project/vectrix/)
65
+ [![License](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](LICENSE)
66
+ [![Tests](https://img.shields.io/badge/Tests-275%20passed-brightgreen?style=flat-square)]()
67
+ [![Sponsor](https://img.shields.io/badge/Sponsor-Buy%20Me%20a%20Coffee-orange?style=flat-square&logo=buy-me-a-coffee&logoColor=white)](https://buymeacoffee.com/eddmpython)
68
+
69
+ ---
70
+
71
+ [Installation](#installation) · [Quick Start](#quick-start) · [Features](#features) · [API](#api-reference) · [한국어](README_KR.md)
72
+
73
+ </div>
74
+
75
+ <br>
76
+
77
+ ```
78
+ 3 dependencies 30+ models 1 line of code
79
+ ───────────── ────────── ──────────────
80
+ numpy AutoETS from vectrix import forecast
81
+ scipy AutoARIMA result = forecast(data, steps=12)
82
+ pandas Theta/DOT print(result)
83
+ TBATS
84
+ GARCH
85
+ ...
86
+ ```
87
+
88
+ <br>
89
+
90
+ ## Quick Start
91
+
92
+ ```bash
93
+ pip install vectrix
94
+ ```
95
+
96
+ ```python
97
+ from vectrix import forecast
98
+
99
+ result = forecast("sales.csv", steps=12)
100
+ print(result)
101
+ result.plot()
102
+ result.to_csv("output.csv")
103
+ ```
104
+
105
+ One call. Auto model selection, flat-line prevention, confidence intervals, and a plot.
106
+
107
+ <br>
108
+
109
+ ## Why Vectrix?
110
+
111
+ | | Vectrix | statsforecast | Prophet | Darts |
112
+ |:--|:-:|:-:|:-:|:-:|
113
+ | **Zero-config auto-forecast** | **Yes** | Yes | -- | -- |
114
+ | **Pure Python (no heavy deps)** | **Yes** | -- | -- | -- |
115
+ | **30+ models built-in** | **Yes** | Yes | -- | Yes |
116
+ | **Flat prediction defense** | **Yes** | -- | -- | -- |
117
+ | **Adversarial stress testing** | **Yes** | -- | -- | -- |
118
+ | **Forecast DNA fingerprinting** | **Yes** | -- | -- | -- |
119
+ | **Business constraints (8 types)** | **Yes** | -- | -- | -- |
120
+ | **R-style regression** | **Yes** | -- | -- | -- |
121
+
122
+ > `numpy` + `scipy` + `pandas` -- that's the entire install.
123
+
124
+ <br>
125
+
126
+ ## Features
127
+
128
+ <details open>
129
+ <summary><b>Core Models</b></summary>
130
+
131
+ | Model | Description |
132
+ |-------|-------------|
133
+ | AutoETS | 30 Error x Trend x Seasonal combinations, AICc selection |
134
+ | AutoARIMA | Seasonal ARIMA, stepwise order selection |
135
+ | Theta / DOT | Original Theta + Dynamic Optimized Theta |
136
+ | AutoCES | Complex Exponential Smoothing (Svetunkov 2023) |
137
+ | AutoTBATS | Trigonometric multi-seasonal decomposition |
138
+ | GARCH | GARCH, EGARCH, GJR-GARCH volatility models |
139
+ | Croston | Classic, SBA, TSB for intermittent demand |
140
+ | Logistic Growth | Saturating trends with capacity constraints |
141
+ | AutoMSTL | Multi-seasonal decomposition + ARIMA residuals |
142
+ | Baselines | Naive, Seasonal Naive, Mean, Drift, Window Average |
143
+
144
+ </details>
145
+
146
+ <details>
147
+ <summary><b>Novel Methods</b></summary>
148
+
149
+ | Method | Description |
150
+ |--------|-------------|
151
+ | Lotka-Volterra Ensemble | Ecological competition dynamics for model weighting |
152
+ | Phase Transition | Critical slowing down for regime shift prediction |
153
+ | Adversarial Stress | 5 perturbation operators for robustness analysis |
154
+ | Hawkes Demand | Self-exciting point process for clustered demand |
155
+ | Entropic Confidence | Shannon entropy uncertainty quantification |
156
+
157
+ </details>
158
+
159
+ <details>
160
+ <summary><b>Adaptive Intelligence</b></summary>
161
+
162
+ | Feature | Description |
163
+ |---------|-------------|
164
+ | Regime Detection | Pure numpy HMM (Baum-Welch + Viterbi) |
165
+ | Self-Healing | CUSUM + EWMA drift detection, conformal correction |
166
+ | Constraints | 8 types: non-negative, range, capacity, YoY, sum, monotone, ratio, custom |
167
+ | Forecast DNA | 65+ feature fingerprinting, meta-learning recommendation |
168
+ | Flat Defense | 4-level prevention system |
169
+
170
+ </details>
171
+
172
+ <details>
173
+ <summary><b>Regression & Diagnostics</b></summary>
174
+
175
+ | Feature | Description |
176
+ |---------|-------------|
177
+ | Methods | OLS, Ridge, Lasso, Huber, Quantile |
178
+ | Formula | R-style `regress(data=df, formula="y ~ x1 + x2")` |
179
+ | Diagnostics | Durbin-Watson, Breusch-Pagan, VIF, normality |
180
+ | Variable Selection | Stepwise, regularization CV, best subset |
181
+ | Time Series | Newey-West, Cochrane-Orcutt, Granger causality |
182
+
183
+ </details>
184
+
185
+ <details>
186
+ <summary><b>Business Intelligence</b></summary>
187
+
188
+ | Feature | Description |
189
+ |---------|-------------|
190
+ | Anomaly Detection | Automated outlier identification and explanation |
191
+ | What-if Analysis | Scenario-based forecast simulation |
192
+ | Backtesting | Rolling origin cross-validation |
193
+ | Hierarchy | Bottom-up, top-down, MinTrace reconciliation |
194
+ | Intervals | Conformal + bootstrap prediction intervals |
195
+
196
+ </details>
197
+
198
+ <br>
199
+
200
+ ## Installation
201
+
202
+ ```bash
203
+ pip install vectrix # Core (numpy + scipy + pandas)
204
+ pip install "vectrix[numba]" # + Numba JIT (2-5x speedup)
205
+ pip install "vectrix[ml]" # + LightGBM, XGBoost, scikit-learn
206
+ pip install "vectrix[all]" # Everything
207
+ ```
208
+
209
+ **Requirements:** Python 3.10+
210
+
211
+ <br>
212
+
213
+ ## Usage Examples
214
+
215
+ ### Easy API
216
+
217
+ ```python
218
+ from vectrix import forecast, analyze, regress
219
+
220
+ result = forecast([100, 120, 115, 130, 125, 140], steps=5)
221
+
222
+ report = analyze(df, date="date", value="sales")
223
+ print(f"Difficulty: {report.dna.difficulty}")
224
+
225
+ model = regress(data=df, formula="sales ~ temperature + promotion")
226
+ print(model.summary())
227
+ ```
228
+
229
+ ### DataFrame Workflow
230
+
231
+ ```python
232
+ from vectrix import forecast, analyze
233
+ import pandas as pd
234
+
235
+ df = pd.read_csv("data.csv")
236
+
237
+ report = analyze(df, date="date", value="sales")
238
+ print(report.summary())
239
+
240
+ result = forecast(df, date="date", value="sales", steps=30)
241
+ result.plot()
242
+ result.to_csv("forecast.csv")
243
+ ```
244
+
245
+ ### Direct Engine Access
246
+
247
+ ```python
248
+ from vectrix.engine import AutoETS, AutoARIMA
249
+ from vectrix.adaptive import ForecastDNA
250
+
251
+ ets = AutoETS(period=7)
252
+ ets.fit(data)
253
+ pred, lower, upper = ets.predict(30)
254
+
255
+ dna = ForecastDNA()
256
+ profile = dna.analyze(data, period=7)
257
+ print(f"Difficulty: {profile.difficulty}")
258
+ print(f"Recommended: {profile.recommendedModels}")
259
+ ```
260
+
261
+ ### Business Constraints
262
+
263
+ ```python
264
+ from vectrix.adaptive import ConstraintAwareForecaster, Constraint
265
+
266
+ caf = ConstraintAwareForecaster()
267
+ result = caf.apply(predictions, lower95, upper95, constraints=[
268
+ Constraint('non_negative', {}),
269
+ Constraint('range', {'min': 100, 'max': 5000}),
270
+ Constraint('capacity', {'capacity': 10000}),
271
+ Constraint('yoy_change', {'maxPct': 30, 'historicalData': past_year}),
272
+ ])
273
+ ```
274
+
275
+ ### Classic API
276
+
277
+ ```python
278
+ from vectrix import Vectrix
279
+
280
+ fx = Vectrix(verbose=True)
281
+ result = fx.forecast(df, dateCol="date", valueCol="sales", steps=30)
282
+
283
+ if result.success:
284
+ print(f"Model: {result.bestModelName}")
285
+ print(f"Predictions: {result.predictions}")
286
+ ```
287
+
288
+ <br>
289
+
290
+ ## API Reference
291
+
292
+ ### Easy API (Recommended)
293
+
294
+ | Function | Description |
295
+ |----------|-------------|
296
+ | `forecast(data, steps=30)` | Auto model selection forecasting |
297
+ | `analyze(data)` | DNA profiling, changepoints, anomalies |
298
+ | `regress(y, X)` / `regress(data=df, formula="y ~ x")` | Regression with diagnostics |
299
+ | `quick_report(data, steps=30)` | Combined analysis + forecast |
300
+
301
+ ### Classic API
302
+
303
+ | Method | Description |
304
+ |--------|-------------|
305
+ | `Vectrix().forecast(df, dateCol, valueCol, steps)` | Full pipeline |
306
+ | `Vectrix().analyze(df, dateCol, valueCol)` | Data analysis |
307
+
308
+ ### Return Objects
309
+
310
+ | Object | Key Attributes |
311
+ |--------|---------------|
312
+ | `EasyForecastResult` | `.predictions` `.dates` `.lower` `.upper` `.model` `.plot()` `.to_csv()` `.to_json()` |
313
+ | `EasyAnalysisResult` | `.dna` `.changepoints` `.anomalies` `.features` `.summary()` |
314
+ | `EasyRegressionResult` | `.coefficients` `.pvalues` `.r_squared` `.f_stat` `.summary()` `.diagnose()` |
315
+
316
+ <br>
317
+
318
+ ## Architecture
319
+
320
+ ```
321
+ vectrix/
322
+ ├── easy.py forecast(), analyze(), regress()
323
+ ├── vectrix.py Vectrix class (full pipeline)
324
+ ├── types.py ForecastResult, DataCharacteristics
325
+ ├── engine/ 30+ statistical models
326
+ │ ├── ets.py AutoETS (30 combinations)
327
+ │ ├── arima.py AutoARIMA (AICc stepwise)
328
+ │ ├── theta.py Theta method
329
+ │ ├── dot.py Dynamic Optimized Theta
330
+ │ ├── ces.py Complex Exponential Smoothing
331
+ │ ├── tbats.py TBATS / AutoTBATS
332
+ │ ├── mstl.py Multi-Seasonal Decomposition
333
+ │ ├── garch.py GARCH / EGARCH / GJR-GARCH
334
+ │ ├── croston.py Croston Classic / SBA / TSB
335
+ │ ├── logistic.py Logistic Growth
336
+ │ ├── hawkes.py Hawkes Intermittent Demand
337
+ │ ├── lotkaVolterra.py Lotka-Volterra Ensemble
338
+ │ ├── phaseTransition.py Phase Transition Forecaster
339
+ │ ├── adversarial.py Adversarial Stress Tester
340
+ │ ├── entropic.py Entropic Confidence Scorer
341
+ │ └── turbo.py Numba JIT acceleration
342
+ ├── adaptive/ Regime, self-healing, constraints, DNA
343
+ ├── regression/ OLS, Ridge, Lasso, Huber, Quantile
344
+ ├── business/ Anomaly, backtest, what-if, metrics
345
+ ├── flat_defense/ 4-level flat prediction prevention
346
+ ├── hierarchy/ Bottom-up, top-down, MinTrace
347
+ ├── intervals/ Conformal + bootstrap intervals
348
+ ├── ml/ LightGBM, XGBoost wrappers
349
+ └── global_model/ Cross-series forecasting
350
+ ```
351
+
352
+ <br>
353
+
354
+ ## Contributing
355
+
356
+ ```bash
357
+ git clone https://github.com/eddmpython/vectrix.git
358
+ cd vectrix
359
+ uv sync --extra dev
360
+ uv run pytest
361
+ ```
362
+
363
+ <br>
364
+
365
+ ## Support
366
+
367
+ If you find Vectrix useful, consider supporting the project:
368
+
369
+ <a href="https://buymeacoffee.com/eddmpython">
370
+ <img src="https://img.shields.io/badge/Buy%20Me%20a%20Coffee-Support%20Vectrix-orange?style=for-the-badge&logo=buy-me-a-coffee&logoColor=white" alt="Buy Me a Coffee">
371
+ </a>
372
+
373
+ <br>
374
+
375
+ ## License
376
+
377
+ [MIT](LICENSE) -- Use freely in personal and commercial projects.