Skip to content

Add preprocessing, fit, and prediction reports - #719

Open
janrth wants to merge 4 commits into
Nixtla:mainfrom
janrth:feat/model_report
Open

Add preprocessing, fit, and prediction reports#719
janrth wants to merge 4 commits into
Nixtla:mainfrom
janrth:feat/model_report

Conversation

@janrth

@janrth janrth commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds lightweight, inspectable reports to show what happens at MLForecast's preprocessing and model-execution boundaries.

  • feature_preparation_report_ records input/output backend, shape, dtypes, memory, row drops, MLForecast-owned conversions, and preprocessing duration.
  • model_fit_report_ records estimator fit-call count and elapsed time per configured model, including direct-model horizon fits.
  • fit_report_ records end-to-end MLForecast.fit() elapsed time and process RSS change, with the nested model-fit report.
  • predict_report_ records end-to-end MLForecast.predict() elapsed time, process RSS change, and requested horizon.

The reports are created after successful operations and provide both dataclass attributes and to_dict() for logging/benchmarking.

Scope and interpretation

RSS measurements use psutil when available. They measure process-level resident-memory change at the operation boundary, so they are useful for comparing configurations such as pandas vs. Polars or as_numpy=True vs. False. They do not attribute memory to a specific native LightGBM/XGBoost/CatBoost allocation, nor do they represent temporary peak memory that was released before the measurement ended.

Estimator timing is measured around the actual cloned estimator .fit() call. It therefore captures model-side work and MLForecast conversions that happen immediately at that boundary, while fit_report_ retains the complete MLForecast fit duration.

@janrth
janrth marked this pull request as ready for review August 19, 2026 08:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1898b42f37

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread mlforecast/forecast.py Outdated
@codspeed-hq

codspeed-hq Bot commented Aug 21, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 12 untouched benchmarks


Comparing janrth:feat/model_report (79b022d) with main (eff8ddb)

Open in CodSpeed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant