Repository navigation
Benchmark Industrial Migration
Эта страница перенесена из документации репозитория, чтобы справочные материалы по методам, экспериментам и бенчмаркам жили в wiki, а не в кодовой ветке.
This page replaces the old benchmark.v2 quickstart. The runtime package for new benchmark work is now benchmark.industrial.
Historical folders such as benchmark/results/v2_kernel_learning may still be used as data sources, but they are not import targets.
The simplest way to run the benchmark stack is through presets.
from benchmark.industrial import run_local_benchmark_preset
result = run_local_benchmark_preset(
"m4",
subset="daily",
sample_size=2,
persist_on_run=True,
output_dir="benchmark/results/industrial_demo/m4_daily",
)python -m benchmark.industrial m4 --subset daily --sample-size 2 --output-dir benchmark/results/industrial_demo/m4_dailySupported preset names:
m4monash
Example:
from benchmark.industrial import run_local_benchmark_preset
result = run_local_benchmark_preset(
"monash",
dataset_name="Bitcoin",
subset="daily",
sample_size=2,
persist_on_run=True,
output_dir="benchmark/results/industrial_demo/monash_bitcoin",
)from benchmark.industrial import run_local_benchmark_preset
tsc_result = run_local_benchmark_preset(
"ucr",
dataset_name="Lightning7",
persist_on_run=True,
output_dir="benchmark/results/industrial_demo/ucr_lightning7",
)
tser_result = run_local_benchmark_preset(
"tser",
dataset_name="NaturalGasPricesSentiment",
persist_on_run=True,
output_dir="benchmark/results/industrial_demo/tser_natural_gas",
)If every run should be indexed automatically, use the registered entrypoints.
from benchmark.industrial import run_registered_preset
bundle = run_registered_preset(
"ucr",
dataset_name="Lightning7",
output_dir="benchmark/results/industrial_study/ucr_lightning7",
persist_on_run=True,
)
print(bundle.registry_entry_path)
print(bundle.summary_path)Manifest examples now live under examples/utils/current_api/manifests and use JSON by default.
from benchmark.industrial import run_manifest_path
result = run_manifest_path("examples/utils/current_api/manifests/m4_daily_preset.json")To inspect the resolved manifest without running training:
from benchmark.industrial import load_manifest, render_resolved_manifest
payload = load_manifest("examples/utils/current_api/manifests/m4_daily_preset.json")
resolved = render_resolved_manifest(payload)CLI usage:
python -m benchmark.industrial --manifest examples/utils/current_api/manifests/m4_daily_preset.json
python -m benchmark.industrial --manifest examples/utils/current_api/manifests/m4_daily_preset.json --print-resolved-manifestTo compare multiple registered runs in the same output root:
from benchmark.industrial import compare_registered_runs
comparison = compare_registered_runs(
"benchmark/results/industrial_study/ucr_lightning7",
output_dir="benchmark/results/industrial_study/ucr_lightning7/_comparison",
)This produces registry overview tables, best-model-per-run tables, model-vs-run matrices, markdown summaries, and plots.
Programmatic entrypoints:
run_forecasting_benchmark_suite(...)run_tsc_benchmark_suite(...)run_tser_benchmark_suite(...)run_local_benchmark_preset(...)run_manifest(...)run_manifest_path(...)run_registered_preset(...)run_registered_manifest(...)run_registered_manifest_path(...)compare_registered_runs(...)
CLI:
python -m benchmark.industrial <preset> [options]
python -m benchmark.industrial --manifest <path> [options]This document replaces the old Benchmark V2 migration guide. The canonical runtime package is now benchmark.industrial.
Use historical benchmark/results/v2_kernel_learning folders only as result data. Do not import the removed versioned runtime package in new code.
Migrate from legacy benchmark entrypoints:
benchmark/benchmark_TSF.pybenchmark/benchmark_TSC.pybenchmark/benchmark_TSER.py
into the current typed benchmark stack:
- typed suite configs;
- JSON defaults and manifests;
- registered runs;
- shared aggregation and visualization;
- showcase-driven public comparisons.
Old:
from benchmark.benchmark_TSF import BenchmarkTSFNew:
from benchmark.industrial import run_forecasting_benchmark_suite
from benchmark.industrial import run_local_benchmark_preset
from benchmark.industrial import run_manifest_pathOld:
from benchmark.benchmark_TSC import BenchmarkTSCNew:
from benchmark.industrial import run_tsc_benchmark_suite
from benchmark.industrial import run_local_benchmark_presetOld:
from benchmark.benchmark_TSER import BenchmarkTSERNew:
from benchmark.industrial import run_tser_benchmark_suite
from benchmark.industrial import run_local_benchmark_preset- Stop adding new logic to root-level legacy benchmark files.
- Put new runtime code under the relevant
benchmark/industrial/<domain>package. - Normalize inputs into
BenchmarkSuiteConfig,DatasetSpec,ModelSpec,RunSpec, andArtifactSpec. - Keep model lists, dataset lists, metrics, and output templates in package-local JSON defaults when they are catalog-like data.
- Use
run_registered_suite,run_registered_preset, orrun_registered_manifest_pathfor persisted studies. - Use
benchmark.industrial.evaluationandbenchmark.industrial.visualizationfor aggregation and plots. - Add public result sources to
benchmark/results/showcase/showcase_manifest.json.
from benchmark.industrial import ArtifactSpec, BenchmarkSuiteConfig, DatasetSpec, ModelSpec, RunSpec, TaskType
config = BenchmarkSuiteConfig(
task_type=TaskType.FORECASTING,
datasets=(DatasetSpec(dataset_name="M4_Daily", source="local_m4", params={"subset": "daily", "sample_size": 2}),),
models=(ModelSpec(adapter_name="naive_last_value", display_name="NaiveLastValue"),),
artifact_spec=ArtifactSpec(output_dir="benchmark/results/industrial_demo"),
run_spec=RunSpec(run_name="forecasting_demo", primary_metric="mae"),
)from benchmark.industrial import run_manifest_path
result = run_manifest_path("examples/utils/current_api/manifests/m4_daily_preset.json")benchmark.industrial.legacy contains compatibility wrappers for old flows that still need them. These wrappers may delegate to the current runtime internally, but new code should not copy their ApiTemplate usage or old root-script style.
This page is kept in docs/benchmark_v2 as a migration landing page for older links. The active runtime package is benchmark.industrial.
benchmark.industrial is the benchmark stack for time series forecasting, classification, and regression in this repository. It provides a typed, reproducible, artifact-oriented workflow with:
- forecasting on local
M4andMonashsubsets; - time series classification on local
UCR/UEAdatasets; - time series regression on local TSER datasets;
- publication-ready artifact packs;
- manifest-driven execution;
- registered runs and run-to-run comparison;
- canonical result showcase generation.
The current implementation covers:
-
forecasting; -
ts_classification; -
ts_regression.
-
benchmark/industrial/core.py: shared dataclasses and task-agnostic result schema. -
benchmark/industrial/forecasting.py: forecasting adapters, metrics, model adapters, and suite runner. -
benchmark/industrial/classification.py: TSC adapters, metrics, baselines, and artifact rendering. -
benchmark/industrial/regression.py: TSER adapters, metrics, baselines, and artifact rendering. -
benchmark/industrial/evaluation/: aggregation, result analysis, diagnostics, and evolution analysis. -
benchmark/industrial/visualization/: reusable report and forecast-comparison plots. -
benchmark/industrial/experiments/: manifests, presets, registry, persistence, and run comparison. -
benchmark/industrial/cli.py: package CLI used bypython -m benchmark.industrial.
- Direct
BenchmarkSuiteConfigfor full programmatic control. - Presets for quick local runs:
m4,monash,ucr,tser. - JSON manifests for reproducible experiment descriptions.
- Registered runs for persisted studies and paper-oriented workflows.
Registered suite runs should write:
<output_dir>/<run_id>/
records/
aggregate/
resolved_config.json
resolved_manifest.json
run_summary.json
artifact_manifest.json
The public benchmark window is generated from:
python -m benchmark.results.showcaseThese notes supersede the old Benchmark V2 release notes. The active runtime package is benchmark.industrial.
The benchmark layer now uses one canonical package for forecasting, time series classification, and time series regression. The old versioned runtime name should not be used in new imports.
- Unified benchmark schema for
forecasting,ts_classification, andts_regression. - Local dataset adapters for M4, Monash, UCR/UEA-style classification, and TSER data.
- JSON manifest-driven execution.
- Preset-based execution for standard local runs.
- Registered run bundles with result persistence.
- Shared aggregation, diagnostics, and visualization modules.
- Public result showcase under
benchmark/results/showcase. - Compatibility wrappers under
benchmark.industrial.legacywhere older flows still need them.
run_forecasting_benchmark_suite(...)run_tsc_benchmark_suite(...)run_tser_benchmark_suite(...)run_local_benchmark_preset(...)run_manifest(...)run_manifest_path(...)run_registered_preset(...)run_registered_manifest(...)run_registered_manifest_path(...)compare_registered_runs(...)
python -m benchmark.industrial <preset> [options]
python -m benchmark.industrial --manifest <path> [options]- External deep baselines are optional and may be reported as
skippedornot_available. - Historical result folders can be used as reference data, but they are not runtime modules.
- The benchmark layer is optimized for local reproducible runs and artifact generation, not as a dashboard product.
This document explains the operational workflow
of run_forecasting_suite(...) and the two
new regime-aware helpers:
analyze_regime_diagnostics(...)recommend_forecasting_model(...)
The goal is to give external contributors a compact mental model of the forecasting benchmark runtime, the main extension points, and the data contracts that flow through the system.
- Entry Point
- High-Level Workflow
- Stage-by-Stage Breakdown
- Core Runtime Objects
- Diagnostics and Routing
- Metrics and Records
- Failure and Optional-Model Paths
- Developer Hints
- Common Pitfalls
Primary runtime entry point:
run_forecasting_suite(...)
Typical orchestration wrapper:
run_forecasting_benchmark_suite(...)
Important supporting modules:
- dataset/model contracts:
core.py - publication artifacts:
analytics.py - progress logging:
progress.py - presets and local runs:
presets.py
flowchart TD
A["BenchmarkSuiteConfig"] --> B["validate_forecasting_suite_config"]
B --> C["Create run_id and progress monitor"]
C --> D["For each DatasetSpec"]
D --> E["build_dataset_adapter"]
E --> F["load_series -> ForecastingSeriesRecord[]"]
F --> G["For each ModelSpec"]
G --> H["build_model_adapter"]
H --> I["availability()"]
I -->|"not available / skipped"| J["Emit BenchmarkRunRecord with status and metadata"]
I -->|"available"| K["For each ForecastingSeriesRecord"]
K --> L["analyze_regime_diagnostics(train)"]
L --> M["recommend_forecasting_model(diagnostics)"]
M --> N["model.forecast(series_record)"]
N --> O["Validate horizon"]
O --> P["compute_forecasting_metric for aggregate metrics"]
P --> Q["compute_pointwise_metric for horizon-wise metrics"]
Q --> R["append event-aware metrics if mask exists"]
R --> S["Create PredictionRecord, MetricRecord, BenchmarkRunRecord"]
J --> T["Continue model / dataset loop"]
S --> T
T --> U["build_leaderboard"]
U --> V["ForecastingBenchmarkResult"]
run_forecasting_suite(...) starts by validating the benchmark configuration.
Responsibilities:
- ensure
task_type == forecasting - ensure datasets and models are present
- ensure only supported metrics are requested
Why this matters:
- keeps adapter/model failures separate from configuration failures
- makes benchmark runs deterministic and reviewable
The function initializes:
run_idseries_recordsrun_recordsprediction_recordsmetric_recordsBenchmarkProgressMonitor
This stage does not perform forecasting yet. It prepares the shell that will collect the benchmark state.
For each DatasetSpec:
-
build_dataset_adapter(dataset_spec)selects the appropriate adapter. -
dataset_adapter.load_series(dataset_spec)returns a tuple ofForecastingSeriesRecord. - The progress monitor is updated with dataset-level counts.
Typical adapters:
M4AdapterMonashAdapterInMemoryForecastingAdapter
Each adapter is responsible for:
- reading raw source data
- producing clean
train_values/test_values - preserving split provenance in metadata
For each ModelSpec:
-
build_model_adapter(model_spec)constructs the runtime adapter. -
model.availability()decides whether the model is executable in the current environment.
Two branches are possible:
-
RunStatus.SUCCESS: proceed to actual forecasting -
RunStatus.SKIPPED/RunStatus.NOT_AVAILABLE: emit run records without forecasting
This separation is important for optional heavy models such as external deep baselines.
For each ForecastingSeriesRecord:
-
analyze_regime_diagnostics(train_values)computes structural diagnostics. -
recommend_forecasting_model(diagnostics)produces an explainable routing suggestion. -
model.forecast(series_record)produces forecast values and model metadata. - The forecast horizon is validated against
test_values. - Aggregate and pointwise metrics are computed.
- Event-aware metrics are appended when the model returns a forcing mask.
- Prediction, metric, and run records are persisted in memory.
After all dataset/model/series loops finish:
-
build_leaderboard(...)aggregates successful run records by benchmark, dataset, and model - the function
returns
ForecastingBenchmarkResult
run_forecasting_benchmark_suite(...) can then build publication artifacts and issue reports on top of this result
bundle.
Represents one benchmarked time series with a fixed train/test split.
Key fields:
- benchmark
- dataset_name
- subset
- series_id
- frequency
- forecast_horizon
- seasonal_period
- train_values
- test_values
- metadata
Represents one model run on one series.
Key fields:
- status
- metrics_summary
- message
- tags
- metadata
Important metadata payloads currently present in forecasting runs:
regime_diagnosticsrouting_recommendation- model-specific metadata such as:
- OKHS diagnostics
- HAVOK forcing mask
- active/calm interval counts
Stores either aggregate or horizon-wise metric values.
Distinguishing field:
-
horizon_index is None-> aggregate metric -
horizon_index is not None-> per-horizon metric
Stores one forecast value per horizon step.
This function converts a raw train series into a typed structural summary.
Computed signals:
series_lengthdominant_periodacf_decay_ratespectral_concentrationspectral_flatnesslocal_linearity_scoreswitching_scoreregime_hint
Conceptually it answers:
- is the series periodic?
- does it look switching or bursty?
- is it mostly locally linear?
- is the structure weak or unstable?
This function takes the typed diagnostics and emits a typed routing recommendation.
Current primary routes:
- periodic ->
mssaorssa_compat - switching / event-driven ->
havok - locally linear ->
okhs - insufficient or weak structure ->
naive_last_value/linear_trend
Returned object:
RegimeRoutingDecision
Important fields:
primary_adaptercandidate_adaptersfallback_adapterconfidencerationale
Why this is useful:
- benchmark artifacts can explain what the system thinks the regime is
- future orchestration can turn the same recommendation into actual model selection
The forecasting suite computes two categories of metrics.
Produced by compute_forecasting_metric(...):
maermsesmapemaseowa
Produced by compute_pointwise_metric(...) and stored with horizon_index.
Produced by _append_event_interval_metrics(...) when forecast_forcing_mask is present.
Current outputs:
mae_activemae_calmactive_forecast_stepscalm_forecast_steps
This makes HAVOK and future event-aware models benchmarkable without changing the global result schema.
If model.availability() reports a non-success status:
- the suite still emits one
BenchmarkRunRecordper series - the record includes:
optionalregime_diagnosticsrouting_recommendation
- no metrics or predictions are generated
Two failure channels exist:
-
ModelExecutionError: expected benchmark/runtime failure with explicit status - generic
Exception: unexpected failure, converted toRunStatus.FAILED
In both cases the suite preserves diagnostics metadata, which is important for post-mortem debugging.
Make sure it returns valid ForecastingSeriesRecord objects and preserves split provenance in metadata.
The adapter should return:
- forecast array with the correct horizon
- typed or plain-JSON-compatible metadata
- availability status for optional environments
Prefer adding them as typed records first, then serialize via .to_dict() into benchmark metadata.
Keep three layers separate:
- measurement:
analyze_regime_diagnostics(...) - recommendation:
recommend_forecasting_model(...) - execution: the actual selected model adapter
This separation is what keeps the system reviewable.
Do not change the core result schema unless necessary. Prefer adding new metadata fields or publication-layer views.
routing_recommendation is currently advisory metadata, not a forced execution path.
Adapters must preserve how the train/test split was produced. Without this, benchmark comparisons become hard to trust.
model.forecast(...) must match the target horizon exactly. Otherwise run_forecasting_suite(...) will emit a failed
record.
Keep aggregate leaderboard metrics separate from horizon-wise diagnostics.
Optional models should surface skipped / not_available explicitly instead of failing silently.
benchmark/v2/core.pybenchmark/v2/forecasting.pyfedot_ind/core/models/ts_forecasting/regime_diagnostics.pyfedot_ind/core/models/ts_forecasting/regime_routing.pybenchmark/v2/analytics.py