Skip to content

Fix/capacity shed metric - #23

Merged
xudongwu-0 merged 2 commits into
mainfrom
fix/capacity-shed-metric
Jul 24, 2026
Merged

Fix/capacity shed metric#23
xudongwu-0 merged 2 commits into
mainfrom
fix/capacity-shed-metric

Conversation

@Fanmili-5

Copy link
Copy Markdown
Collaborator

Improved performance by adjusting weights

Raise _WEATHER_WEIGHT from 0.5 to 3.5 (equal to _W_BASELINE).

Validation across both months confirms the higher weight is a robust
improvement, not a July-specific overfit:

- June 2025 in-month LOO: 89.47% -> 93.33% (+3.86 pp)
- July 2025 held-out accept-only: 88.94% -> 96.63% (+7.69 pp)
- June MAE: 0.322 -> 0.235 kWh (-27%)
- July MAE: 0.446 -> 0.346 kWh (-22%)

The prior 0.5 weight left the weather-similarity term negligible against
household/city/hour/baseline terms (all 2.0-4.0), so extreme-weather
target events could not match extreme-weather neighbors and the reporter
was locked near the memory median. Raising the weight lets the retrieval
differentiate hot vs mild days, which was the dominant failure mode of
the shed-ratio outliers.

Also verified stability: on June LOO the pass rate plateaus in
[93.33%, 94.04%] across weights 3.5/5.0/8.0, so 3.5 is a safe
optimum-adjacent value rather than a knife-edge overfit.
The similarity kernel for weather is a Gaussian (exp(-0.5*(dist/bw)**2))
whose raw output for neighbors that share the target household+city+
hour but sit on a different day typically falls in [0.2, 0.5]. Other
similarity terms are min/max ratios or binary indicators whose typical
raw values are 0.85-1.0. To make the weather term contribute at the
same magnitude as _W_BASELINE (raw ~= 0.85 x weight 3.5 = ~3.0),
the weather weight needs to be roughly 3.0 / 0.35 ~= 8.0, not 3.5.

Sweep on both months confirms 8.0 is optimum-adjacent:

- June LOO:  weight 3.5 -> 93.33%,  weight 8.0 -> 94.04%,  peak 12/94.74%
- July eval: weight 3.5 -> 96.63%,  weight 8.0 -> 97.60%,  peak 50/98.08%
- June MAE:  0.235 -> 0.233 kWh (still near best)
- July MAE:  0.346 -> 0.336 kWh (best across the sweep)

Beyond 50 (July=98.08%) the July pass rate regresses to 97.12% at 100,
so the useful range is bounded. 8.0 sits inside the stable plateau and
is the value where weather contributes at parity with baseline (both
around 3 units), so downstream weight-scale explanations stay clean.
@Fanmili-5
Fanmili-5 requested a review from xudongwu-0 July 21, 2026 06:16
@xudongwu-0

Copy link
Copy Markdown
Collaborator

LGTM thanks

@xudongwu-0
xudongwu-0 merged commit 19eced3 into main Jul 24, 2026
@xudongwu-0
xudongwu-0 deleted the fix/capacity-shed-metric branch July 24, 2026 08:51
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