Repository navigation
Radical Forecasting Refactor Plan
This page was moved from repository documentation to the project wiki.
Original repository path before migration: docs/pr_plans/radical_forecasting_refactor_plan.md.
This document is the source-of-truth for the first radical refactor wave of the forecasting stack in Fedot.Industrial.
The target architecture is:
- forecasting-first rather than generic-FEDOT-first;
- tensor-native inside the forecasting runtime;
- composable by primitive stages instead of monolithic forecaster classes;
- benchmark-aligned with
benchmark/v2; - intentionally willing to simplify or retire legacy compatibility paths.
The current forecasting stack contains several architectural bottlenecks:
- forecasting models mix trajectory construction, decomposition, rank selection, head fitting, diagnostics, and orchestration in one class;
- model tuning is often delegated to generic FEDOT loops that are better suited for tabular or generic pipeline cases than for multi-horizon forecasting;
-
industrial_preprocessing_strategyandindustrial_model_strategyare overloaded with legacy dispatch logic and old compatibility assumptions; - regime diagnostics and benchmark artifacts are richer than the forecasting runtime itself, which creates a mismatch between observability and implementation structure;
- models such as
okhs_forecastingandlagged_forecasterare harder to tune and reason about than their mathematical pipeline suggests.
- Scope of wave 1: only the forecasting stack.
- Canonical evaluation layer:
benchmark/v2. - Canonical internal data format:
torch.Tensor. - FEDOT
InputData/OutputDataremain boundary adapters, not the internal forecasting runtime format. - Public composites in v1 are named models, not a generic builder-first API.
- Backward compatibility is not a primary constraint.
The new forecasting stack is built around a primitive graph:
trajectory_transformdecompositionrank_truncationforecast_head
hankelisation- later:
page_embedding - later:
tensor_hankelisation
svd_decompositionrandomized_svd_decomposition- later:
tensor_decomposition
explained_variance_truncationstatistical_rank_truncationexpert_rank_truncation
ridge_forecasting_headokhs_fdmd_headhavok_headweighted_average_head- later:
deepar_head,nbeats_head
Wave 1 introduces explicit typed runtime objects:
ForecastTensorBatchTrajectoryTransformResultDecompositionResultRankTruncationResultForecastHeadResultForecastingSplitSpecForecastingEvaluationResultForecastingOperationCapabilityTensorDevicePolicy
These types are designed to carry tensor-native forecasting state without depending on generic FEDOT dispatch semantics.
Forecasting models should become thin shells that:
- define sensible defaults;
- assemble primitive stages;
- aggregate diagnostics for API and benchmark consumers.
The heavy lifting must move into deterministic runtime helpers and primitive stages.
Long-term source-of-truth:
hankelisation -> ridge_forecasting_head
Long-term source-of-truth:
hankelisation -> decomposition -> rank_truncation -> okhs_fdmd_head
Long-term source-of-truth:
page_embedding -> decomposition -> rank_truncation -> linear_head
Long-term source-of-truth:
hankelisation -> svd_decomposition -> havok_head
Wave 1 adds three named composite models:
hankelisation -> ridge_forecasting_head
hankelisation -> svd_decomposition -> rank_truncation -> ridge_forecasting_head
- branch A:
lagged_ridge_forecaster - branch B:
low_rank_lagged_ridge_forecaster - branch C: a complex branch such as
havokorokhs - final head:
weighted_average_head
The generic FEDOT forecasting split/evaluation loop is not the target runtime for new industrial forecasting models.
Wave 1 introduces an explicit industrial forecasting runtime with:
- holdout split semantics;
- rolling-origin-ready typed contracts;
- multi-horizon metric evaluation;
- stage-aware diagnostics collection;
- direct tensor-native state flow.
benchmark/v2 remains the canonical evaluation layer.
The refactor should ensure:
-
regime_diagnosticsare always persisted; - model metadata is stage-aware;
- composite models preserve branch-level diagnostics;
- routing evaluation can be compared against winner model families.
-
docs/devsource-of-truth for the refactor; - tensor-native runtime foundation for forecasting primitives;
- first named composite models;
- a new shell-first operator entrypoint:
okhs_fdmd_forecaster
- extracted pure helper layer for OKHS orchestration:
- fit-plan construction
- stage-diagnostics construction
- prediction-plan helpers
- anti-smoothing postprocess helpers
- benchmark adapters for named composite models;
- model family mapping for routing-aware metadata.
- generic stage-aware benchmark artifacts for stage-native forecasting shells:
- per-series
forecasting_stage_diagnostics.json - aggregate
forecasting_stage_diagnosticstables for primitive-stage models
- per-series
- branch-aware benchmark artifacts for composite ensembles:
- per-series
hybrid_ensemble_diagnostics.json - aggregate
hybrid_ensemble_diagnosticstables for ensemble calibration and branch outputs
- per-series
- stage-aware benchmark artifacts for
okhs_fdmd_forecaster:- per-series
okhs_fdmd_stage_diagnostics.json - aggregate
okhs_fdmd_stage_diagnosticstables in the publication pack
- per-series
- stage-aware diagnostics are now emitted directly by additional forecasting models:
HAVOKmSSA-
SSAthrough the sharedmSSAbackend compatibility wrapper
- repository/defaults vocabulary has been aligned with the new forecasting stack:
mssa_forecasterhavok_forecaster- updated
ssa_forecasterdefaults to match the compatibility-shell contract
- forecasting decomposition and rank-truncation primitives as separate industrial operations:
svd_decompositionrandomized_svd_decompositiontensor_decompositionexplained_variance_truncationstatistical_rank_truncationexpert_rank_truncation
- tuning search-space entries for named composite models and primitive forecasting stages;
- an M4 benchmark example for the new composite forecasting stack.
- dedicated thin forecasting runtime strategies:
IndustrialForecastingModelRuntimeStrategyIndustrialForecastingPreprocessingRuntimeStrategy
- repository forecasting metadata redirected away from legacy multidimensional dispatch and toward forecasting-only runtime entrypoints.
- legacy preprocessing entrypoints now explicitly redirect forecasting preprocessing operations such as
hankelisationto the forecasting runtime strategy instead of falling back to legacy multidimensional dispatch. - legacy model entrypoints now explicitly redirect forecasting model operations such as
lagged_ridge_forecasterandokhs_fdmd_forecasterto the forecasting runtime strategy instead of falling back to generic regression-oriented paths. - legacy classes
IndustrialSkLearnForecastingStrategy-
IndustrialForecastingPreprocessingStrategynow act as compatibility wrappers over the new forecasting runtime strategies.
- full removal or reduction of the legacy forecasting codepaths still living inside
industrial_preprocessing_strategyandindustrial_model_strategy; - full decomposition of
okhs_forecastinginto FEDOT pipeline-compatible primitive nodes; - full primitive-node registration in industrial JSON repositories;
- explicit rolling-origin tuning orchestration across all forecasting models;
- neural forecast heads as first-class primitives.
- introduce typed tensor-native runtime;
- keep FEDOT objects only at boundaries;
- stabilize
hankelisationas the reference trajectory transform.
- introduce decomposition and rank-truncation primitives;
- normalize stage diagnostics.
- migrate lagged and low-rank lagged composites;
- begin shell-first migration path for operator models.
-
okhs_fdmd_forecasternow provides a stage-aware forecasting shell over the existing OKHS/fDMD backend.
- add explainable weighted ensembles;
- preserve branch-level diagnostics.
- narrow legacy industrial strategies to thin shells;
- detach forecasting runtime from old multidimensional compatibility flags.
Current status:
- started;
- forecasting repository metadata now points to dedicated forecasting runtime strategies;
- remaining work is to migrate lingering forecasting-specific logic out of the legacy strategy modules entirely.
- align benchmark artifacts with primitive vocabulary;
- compare routing recommendation against winner families on real cohorts.
Current status:
- in progress;
-
benchmark/v2now persists generic primitive-stage artifacts for stage-aware forecasting shells such aslagged_ridge_forecaster,low_rank_lagged_ridge_forecaster,HAVOK, andmSSA/SSA; -
benchmark/v2now persists branch-aware diagnostics forhybrid_ensemble_forecaster; -
benchmark/v2now persists stage-aware series and aggregate artifacts forokhs_fdmd_forecaster; - direct
SSAruntime usage now exposes compatibility and stage diagnostics throughget_diagnostics(); - primary forecasting optimization space now includes additional shell-first models such as
mssa_forecasterandhavok_forecaster; - next useful step is to finish shrinking legacy strategy internals and then move to explicit tuning/orchestration over the primitive graph instead of model-level wrappers.
Any new forecasting model added after this refactor wave should answer three questions explicitly:
- What is the trajectory transform?
- What is the latent/decomposition stage?
- What is the forecast head?
If those three pieces are not separable, the implementation should be treated as incomplete.