Skip to content

Add N-HiTS-comparison traffic example under gists/timeseries/nhits - #52

Merged
OVVO-Financial merged 2 commits into
mainfrom
claude/upbeat-pascal-fq49g2
Jun 18, 2026
Merged

Add N-HiTS-comparison traffic example under gists/timeseries/nhits#52
OVVO-Financial merged 2 commits into
mainfrom
claude/upbeat-pascal-fq49g2

Conversation

@OVVO-Financial

@OVVO-Financial OVVO-Financial commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

Adds gists/timeseries/nhits/ — a third entry in the examples gallery, with a genuine head-to-head against the N-HiTS deep-learning forecaster (AAAI 2023).

Marco Peixeiro's All About N-HiTS forecasts the hourly Interstate 94 traffic series — same dataset, same [:-120]/[-120:] split, same MAE metric this example uses. NNS.ARMA (seasonal periods from nns_seas, MAE objective, no neural network or training loop) lands MAE 236, beating the article's results:

Model MAE Beats naive baseline?
NNS.ARMA.optim 236
Naive seasonal (weekly, K=168) 249
N-HiTS 266
N-BEATS worse than N-HiTS

The article's own conclusion is that neither N-HiTS nor N-BEATS beats the naive seasonal baseline on this series; NNS is the only method that does.

Contents

  • nhits_traffic.py — runnable script (writes the figure for the README).
  • README.md — gallery-style framing, the head-to-head table sourced to the article, the forecast plot, and a "how it works" walkthrough.
  • nhits_traffic_forecast.png — generated figure (actual vs. forecast).

Notes

  • Reproduced the MAE (236.16791666666677) exactly when generating the figure.
  • The README fairly notes the article's caveat that this is a small, repetitive sample (part of why the baseline is strong).
  • gists/ is excluded from ruff; pure examples/docs, no package or test changes.

🤖 Generated with Claude Code

claude added 2 commits June 18, 2026 18:32
Forecast the last 120 steps of an hourly traffic-volume series with
NNS.ARMA (MAE ~236) -- no neural network or training loop -- framed
against the N-HiTS deep-learning forecaster. Includes the script, a
README in the gallery style, and the generated figure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MxVLKYqazC2uuAW3P3MbAm
The datasciencewithmarco walkthrough forecasts the same Interstate 94
series with the same last-120 split and MAE metric: N-HiTS scores 266 and
N-BEATS worse, and neither beats the naive seasonal baseline (249). NNS
lands 236, beating all three. Document the comparison table and source it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MxVLKYqazC2uuAW3P3MbAm
@OVVO-Financial
OVVO-Financial merged commit ea0f80e into main Jun 18, 2026
8 checks passed
@OVVO-Financial
OVVO-Financial deleted the claude/upbeat-pascal-fq49g2 branch June 18, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants