Skip to content

System Overview

This page explains how the repository is organized at a subsystem level.

Two layers

The repository contains two related but distinct layers:

  • foreblocks: the main forecasting library
  • foretools: auxiliary tools for generation, decomposition, and analysis

Core runtime path

The main foreblocks training flow is:

  1. prepare data as windows
  2. build a ForecastingModel
  3. train with Trainer
  4. evaluate with ModelEvaluator

Main subsystems

PathRole
foreblocks/corecore model assembly, heads, conformal prediction, sampling
foreblocks/trainingtraining loop, optimizer/scheduler handling, NAS-aware training support
foreblocks/evaluationevaluation, prediction helpers, metrics, plotting
foreblocks/ts_handlerpreprocessing, normalization, filtering, imputation, window creation
foreblocks/transformertransformer stack, attention variants, MoE, norms, embeddings
dartsneural architecture search and finalization workflow
mltrackerexperiment tracking support
foretools/tsgensynthetic data generation

Public API boundary

The stable starting point is the top-level import surface:

python
from foreblocks import ForecastingModel, Trainer, ModelEvaluator

That boundary is safer than importing deep internal modules unless you are extending the library itself.

Dependency graph

text
foreblocks (main)
├── foreblocks/core          — ForecastingModel, heads, conformal
├── foreblocks/training      — Trainer, optimizer/scheduler
├── foreblocks/evaluation    — ModelEvaluator, metrics
├── foreblocks/ts_handler    — TimeSeriesHandler, preprocessing
├── foreblocks/transformer   — Transformer stack, attention, MoE
├── foreblocks/custom_mamba  — Hybrid Mamba SSM blocks
├── foreblocks/custom_raven  — Raven recurrent blocks
├── foreblocks/kan           — Kolmogorov-Arnold Network
├── mltracker                — Experiment tracking
└── darts (standalone)       — Neural architecture search

foretools (companion)
├── foretools/tsgen          — Synthetic time-series generation
├── foretools/bohb           — Bayesian hyperparameter search
├── foretools/emd_like       — VMD / EMD decomposition
├── foretools/tsaug          — AutoDA augmentation
├── foretools/fengineer      — Feature engineering pipeline
└── foretools/foreminer      — Changepoint detection & mining

Choosing where to start

Your goalStart here
Train a forecasting model from scratchGetting Started
Use raw [T, D] time-series dataPreprocessor Guide
Try different model architecturesTransformer Guide or DARTS Guide
Add uncertainty estimatesUncertainty Quantification
Search for a better architectureRun A DARTS Search
Generate synthetic test dataGenerate Synthetic Series

Design intent

The codebase is organized around modular composition:

  • model composition in ForecastingModel
  • backbone specialization in recurrent and transformer blocks
  • optional preprocessing before training
  • optional architecture search through DARTS
  • optional synthetic data generation in foretools

MIT License