Skip to content
1 change: 1 addition & 0 deletions .github/scripts/check_imports/import_exceptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ files:
- pandas
"components/**/shared/*":
- pandas
- numpy
- component
"pipelines/**/tests/*":
- tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,12 @@ def example_pipeline(
Writes ``component_status.json`` under ``component_status`` with ``component_id`` ``autogluon_timeseries_models_training`` and training stages (``load_data``, ``model_selection``, ``refit_full``, ``evaluate_models``). Artifact metadata display name: **Timeseries Models Training Status**.

Inference notebooks are loaded from ``shared/notebook_templates/timeseries_notebook.ipynb`` at runtime (same shared package data as tabular training).

### Model insight artifacts (per refitted model)

Under each ``{model_name}_FULL/metrics/`` directory:

- **`metrics.json`**: Holdout test metrics from ``TimeSeriesPredictor.evaluate`` (finite values only).
- **`back_testing.json`**: Multi-window backtest summary with ``per_window_metrics`` and ``series_analysis`` (best/worst series forecast timelines). Generated best-effort after refit; omitted when backtest APIs or history length are insufficient.

The timeseries notebook template loads ``back_testing.json`` when present for model insights.
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,30 @@ def replace_placeholder_in_notebook(notebook, replacements):
with (metrics_path / "metrics.json").open("w", encoding="utf-8") as f:
json.dump(metrics_dict, f, indent=2)

from kfp_components.components.training.automl.shared.back_testing import build_back_testing_json

try:
back_testing_payload = build_back_testing_json(
predictor_refit,
model_name=model_name,
model_name_full=model_name_full,
train_data=full_train_ts_df,
eval_metric=eval_metric,
target=target,
id_column=id_column,
timestamp_column=timestamp_column,
prediction_length=prediction_length,
metrics=list(AVAILABLE_METRICS.keys()),
)
with (metrics_path / "back_testing.json").open("w", encoding="utf-8") as f:
json.dump(back_testing_payload, f, indent=2)
except Exception as backtest_exc:
logger.warning(
"Could not generate back_testing.json for model %r: %s. Skipping backtest artifact.",
model_name_full,
backtest_exc,
)

notebook_file = "timeseries_notebook.ipynb"
with (shared_automl_dir() / "notebook_templates" / notebook_file).open("r", encoding="utf-8") as f:
notebook = json.load(f)
Expand All @@ -372,6 +396,7 @@ def replace_placeholder_in_notebook(notebook, replacements):
"predictor": str(Path(model_name_full) / "predictor"),
"notebook": str(Path(model_name_full) / "notebooks" / "automl_predictor_notebook.ipynb"),
"metrics": str(Path(model_name_full) / "metrics"),
"back_testing": str(Path(model_name_full) / "metrics" / "back_testing.json"),
},
"metrics": {
"test_data": metrics_dict,
Expand Down
Loading
Loading