Skip to content

Commit 08b2ca6

Browse files
committed
Add real N-HiTS/N-BEATS head-to-head to nhits README
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
1 parent 95b7ccc commit 08b2ca6

1 file changed

Lines changed: 25 additions & 8 deletions

File tree

gists/timeseries/nhits/README.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ accuracy than Transformer models at ~50× less compute**. It is, however, still
88
neural network: it needs a training loop, hyperparameters, and the hardware to go
99
with them.
1010

11-
This example forecasts the last **120 steps** of an hourly traffic-volume series
12-
with `NNS.ARMA`**no neural network, no training loop, no hyperparameter
13-
search** — in a handful of lines. The seasonal periods are discovered directly
14-
from the data by `nns_seas`.
11+
Marco Peixeiro's walkthrough, [*All About
12+
N-HiTS*](https://www.datasciencewithmarco.com/blog/all-about-n-hits-the-latest-breakthrough-in-time-series-forecasting),
13+
applies N-HiTS to exactly this problem: forecast the last **120 steps** (five
14+
days) of the hourly **Interstate 94 Westbound** traffic-volume series, scored by
15+
MAE. This example runs the *same* dataset, the *same* `[:-120]` / `[-120:]`
16+
split, and the *same* metric — but with `NNS.ARMA` instead of a neural network:
17+
**no training loop, no hyperparameter search**, seasonal periods discovered
18+
directly from the data by `nns_seas`.
1519

1620
## Result
1721

@@ -21,10 +25,23 @@ from the data by `nns_seas`.
2125
MAE on traffic data: 236.16791666666677
2226
```
2327

24-
On a series that swings from ~200 to ~6,200 vehicles, NNS tracks both the sharp
25-
rush-hour peaks and the overnight troughs with a mean absolute error around
26-
**236** — a competitive long-horizon forecast produced in seconds, without any
27-
of the training machinery a neural model requires.
28+
Head-to-head on the identical series, split, and metric (deep-learning numbers
29+
from the article):
30+
31+
| Model | MAE | Beats the naive baseline? |
32+
|-------|----:|:--:|
33+
| **NNS.ARMA.optim** | **236** ||
34+
| Naive seasonal (weekly, K=168) | 249 ||
35+
| N-HiTS | 266 ||
36+
| N-BEATS | worse than N-HiTS ||
37+
38+
The article's punchline is that **neither N-HiTS nor N-BEATS beats the simple
39+
naive seasonal baseline** on this series ("the baseline still outperforms
40+
N-HiTS"). NNS is the only method here that does — an MAE of **236** versus the
41+
baseline's 249 and N-HiTS's 266 — and it gets there in seconds with none of the
42+
training machinery a neural model needs. (In fairness, the article notes this is
43+
a small, repetitive sample, which is partly why the baseline is so strong; the
44+
point is that NNS clears a bar the neural models did not.)
2845

2946
## Run it
3047

0 commit comments

Comments
 (0)