讓總量加總一致
閱讀約需 47 分鐘 分鐘,7 節 中共有 2 個範例。
你會用兩種方式預測三十位客戶的總需求量,根據決策窗口在兩種方式之間做選擇,並且只使用各截止時間點之前的歷史資料,將該總量拆分為各客戶的占比。
供電業者每天只進行一次日前購電,依據的是其所有客戶的總需求量,而不是任何單一客戶的需求量。第 6 章預測了每一位客戶,而總量可以由這些預測值加總得出,也可以直接單獨預測。本章要探討這兩種做法是否一致,以及應該信任哪一種。兩者都在與先前相同的窗口上評分,因此比較是公平的。本章的範例沿用第 6 章的客戶、窗口與尺度,所以這裡的每個數字都由你可以執行的範例印出。
為什麼總量需要檢查
同一個量的兩個預測可能不一致,因為它們經由不同的途徑產生。這裡的量是 30 位客戶(ALL30)在每個小時的總需求。一條途徑是把 30 個客戶的預測加總,另一條途徑是對總量序列配適單一模型。兩者讀取的是相同的讀數,但各有各的失敗方式。加總會把每位客戶的誤差都帶進總量;總量模型只看得到總量本身的模式,各客戶個別的模式可能在其中消失。
這項檢查之所以重要,是因為供應商是依總量而非依個別客戶來採購。即使每位客戶的預測都很準,只要各客戶的誤差在同一個小時偏向同一個方向,總量仍可能預測失準。因此本章依序提出兩個問題。第一,在資料中,各部分加起來是否等於整體?第二,在重要的視窗上,直接預測總量是否優於各部分加總?
加總一致的預測稱為一致(coherent)預測。Hyndman 與 Athanasopoulos 的 Forecasting: Principles and Practice,第 3 版,第 11 章列出數種達成一致的方法,其中兩種與本章相關。由下而上(bottom-up)預測最底層,在此即客戶,再將結果加總。由上而下(top-down)預測最上層,即總量,再按比例向下分配。本章只在這兩種意義上使用這兩個名稱。
一致性是一項限制條件,而不是準確度的衡量。加總一致的總量仍可能比不一致的總量更差。因此本章對總量與各客戶分別評分,絕不因為各部分相符就接受某個預測。
本書以 pandas 手動建立這兩種總量,而不使用 hierarchicalforecast。這個階層只有一層,因此每條途徑都只是一次加總或一次分配,執行時間也維持在很小的程度。確實存在一種能以最佳方式結合兩條途徑的方法。MinT 在無偏假設下,選出使一致預測的均方誤差最小的一致預測,並使用預測誤差的共變異數矩陣(Wickramasuriya、Athanasopoulos 與 Hyndman,2019;公開的工作論文見 robjhyndman.com/papers/mint.pdf)。估計該矩陣本身就是另一項專案,本章不處理。
**實用原則:**只要決策取決於總量,就以兩種方式預測總量。在相同的視窗上為兩者評分,同時對照總量與各客戶。保留在決策視窗上表現較佳的方法,絕不因為各部分加總相符就接受某個總量。
加總各客戶的預測
由下而上的總量預測,是將第 6 章所產生的三十個客戶預測,逐小時加總而得。在每個截止點上,一個全域模型會以延遲 24 與 168 以及第 6 章保留的客戶識別碼,預測每個客戶接下來 24 小時的值。總量在某一小時的預測,就是該小時三十個預測值的總和。若以 c 表示客戶、t 表示小時,規則為 total(t) = sum over c of forecast(c, t)。
加總在構造上必然成立,因此真正需要檢查的是資料。總量序列在每個小時都必須等於三十筆讀數的總和,否則所有分數都是對照錯誤的數值計算的。例外是時鐘變動的小時。時鐘變動旗標會把客戶的讀數設為缺值,因此總量在 2013 年 3 月 31 日與 2014 年 3 月 30 日的 01:00(跳過的小時),以及 2013 年 10 月 27 日與 2014 年 10 月 26 日的 01:00(重複的小時)都是缺值。
以下每個分數都是對照總量計算的,所以總量必須先與其組成部分相符。第一個範例會建立兩種總量並為其評分,其最後幾行會檢查每個無時鐘變動的小時是否相符。
1"""Forecasts the total of the thirty clients two ways, bottom-up (the sum of the client forecasts) and direct (one model on the2total), and chooses between them on the four decision windows by MAE on the total. The choice rests on the two decision-window3MAE lines; the standard cutoffs then report both beside seasonal naive, and the last two lines check the total and the scale."""4import pandas as pd56from lib.baselines import seasonal_scale7from lib.electricity import load8from lib.panel import ALL30, DECISION_CUTOFFS, check_decision_hours9from lib.scoring import actual_hours, score_windows10from lib.settings import EVAL_CUTOFFS, show11from lib.totals import (DIRECT_SCALED, METHODS, TOTAL, direct_windows, plain_mae, pooled_mae, total_checks,12 total_forecasts, total_frame, total_scale_rows)1314raw = load(ALL30)15total = total_frame(raw) # the hourly sum of the thirty clients, after the start rule; missing in a clock-change hour16dec, cut = pd.to_datetime(DECISION_CUTOFFS), pd.to_datetime(EVAL_CUTOFFS)1718dec_actual = actual_hours(total, dec)19# the direct model here uses the target setting the book chose: DIRECT_SCALED is False, so the direct total is unscaled20dec_mae = pooled_mae(dec_actual, total_forecasts(raw, dec), ["bottom-up", "direct"])21# the direct model's MAE with its target scaled (True) and unscaled (False)22direct_setting = {s: pooled_mae(dec_actual, direct_windows(raw, dec, scaled=s), ["direct"])["direct"]23 for s in (True, False)}24# stops the run if the constant no longer names the setting with the lower MAE25if direct_setting[DIRECT_SCALED] != min(direct_setting.values()):26 raise ValueError("DIRECT_SCALED is not the target setting with the lower MAE on the decision windows")27show("decision cutoffs", len(dec))28# raises if a decision hour is a Portuguese holiday or reaches the held-out week; the count is printed for the record29show("decision holiday hours", check_decision_hours(dec_actual))30show("MAE bottom-up, decision windows", dec_mae["bottom-up"])31show("MAE direct, decision windows", dec_mae["direct"])32show("MAE direct with a scaled target, decision windows", direct_setting[True])33show("chosen direct target", "unscaled" if not DIRECT_SCALED else "scaled")34# the bottom-up total without the client identifier, which Chapter 6 also tried35show("MAE bottom-up without identifier, decision windows", plain_mae(raw, dec))36show("chosen total method", dec_mae.idxmin())3738# the scale reads the readings before the first standard cutoff, and no later ones39scale = total_scale_rows(raw, cut[0])40scored, per_client = score_windows(actual_hours(total, cut), total_forecasts(raw, cut), METHODS, scale)41show("scored hours", len(scored))42# seasonal_scale returns one value per unique_id, so [TOTAL] picks the total's43show("MASE scale of the total", seasonal_scale(scale)[TOTAL])44for model in METHODS:45 show(f"MAE {model}", (scored["y"] - scored[model]).abs().mean())46for model in METHODS:47 show(f"MASE {model}", per_client.loc[TOTAL, model])48show("MAE bottom-up without identifier", plain_mae(raw, cut))49# the first cutoff is passed as first_cutoff; the scale check then runs on every cutoff in cut50for label, value in total_checks(raw, cut[0], cut).items():51 show(label, value)
python total-bottom-up-and-direct.pydecision cutoffs: 4
decision holiday hours: 0
MAE bottom-up, decision windows: 1267.47
MAE direct, decision windows: 1678.62
MAE direct with a scaled target, decision windows: 1705.71
chosen direct target: unscaled
MAE bottom-up without identifier, decision windows: 1383.29
chosen total method: bottom-up
scored hours: 72
MASE scale of the total: 2689.26
MAE SeasonalNaive: 3639.41
MAE bottom-up: 2985.88
MAE direct: 3423.11
MASE SeasonalNaive: 1.35
MASE bottom-up: 1.11
MASE direct: 1.27
MAE bottom-up without identifier: 2837.66
clock-free hours where the total differs from the sum of the thirty clients: 0
scale changes after poisoning readings from each scored cutoff: 0
在每個沒有時鐘變動旗標的小時,總量都等於三十個客戶的總和。檢查結果顯示有 0 個小時不一致。
時鐘變動的小時還需要另一條規則。這些小時的總量是缺值,但預測不是缺值。每個預測視窗仍會為每個有標籤的小時產生一個值,所以輸出的網格沒有空洞,下游的資料表也不必填補。評分會拒絕沒有讀數的預測小時,因此被遮蔽的小時不會被當成零來評分。本章中沒有任何評分視窗包含這樣的小時。
起始規則會在加總之前套用到每個客戶。晚開始的客戶在第一筆讀數之前的零並不是需求,所以規則會將其捨棄,如第 4 章對單一客戶所示。這條規則不會改變總量,因為零加進總和中不會有任何影響,尚未開始的客戶同樣沒有貢獻。上述檢查說明了這一點。但這條規則確實會改變每個客戶自身的預測,因為以這些零擬合的模型會把它們學成低用電量。
由下而上的總量會承襲各客戶的誤差,無論好壞。第 6 章發現,在標準截止點上,該模型在三十個客戶中有 23 個優於季節性樸素法,其餘的表現則較差。本章稍後的比較會衡量這些誤差有多少傳遞到總量。
只有平均數可以相加。總和的平均數等於各平均數之和,因為期望值具有線性。但總和的中位數一般而言並不等於各中位數之和,其他分位數也是如此。它們只在特殊情況下才會相加,例如誤差完全同步變動時。因此,由下而上的總量是點預測。無法藉由加總各客戶的區間來建立總量的區間。第 8 章在談區間時會回到這一點。
實用原則: 逐小時加總各客戶的預測,但要先檢查總量序列在每個沒有時鐘變動旗標的小時都等於其讀數之和。在加總之前對每個客戶套用起始規則,使任何客戶的模型都不會以其零值擬合。將加總視為點預測,不要把各客戶中位數的總和當成總量的中位數。
直接預測總量
直接法的總量是以一個模型對總量序列本身進行擬合。它的歷史資料是截止時間點之前的總量歷史:即其前 1,344 小時的讀數,也就是 8 週,與各客戶歷史資料的長度相同。各客戶的歷史資料依起始規則截取,其時鐘切換時段的小時資料以該客戶自身的相鄰讀數補齊,做法與第 3 章相同,然後依小時加總讀數。因此,總量的歷史資料沒有缺漏的小時。
此模型使用與各客戶相同的特徵。其輸入是 24 小時前與 168 小時前的總量讀數,因此沒有任何輸入來自被預測的那一天。其目標為未經縮放的總量原值。第 6 章會縮放各客戶的目標,因為若不如此,以單一模型處理規模不同的客戶,擬合時會偏重大型客戶。單一總量沒有這種規模混合的情況,所以該理由並不適用。在決策窗口上,未縮放的目標誤差較低,為 1678.62 kWh,而縮放目標的誤差為 1705.71 kWh,如第一個範例所示,因此直接法模型採用未縮放的目標。此模型在每個截止時間點各擬合一次,僅使用該時間點的歷史資料,並預測接下來的 24 小時。它是 mlforecast 1.1.0 內的 LightGBM 迴歸器,設定沿用第 5 章。
兩種總量的建構方式不同。由下而上的總量來自預測每個客戶的單一全域模型,直接法的總量則來自預測總和的單一模型。延遲特徵與其他設定相同。目標縮放則不同,並且由決策窗口僅為直接法模型選定。
總量通常比任何單一客戶都平滑,因為各客戶的尖峰在加總時會部分相互抵銷。以較平滑的序列擬合的模型,需要學習的自身雜訊較少,這可能有利於直接法的總量。本章稍後的比較會檢驗在這些窗口上是否如此,而答案與平滑性所暗示的並不相同。
模型只透過歷史資料來觀察總量。它看不到某筆讀數來自哪個客戶,也看不到是哪個客戶使總量變動。這是直接法所做的取捨:它得到一條平滑的序列,卻失去各客戶各自的形狀。由下而上法保留這些形狀,但必須把三十個誤差加在一起。
總量上的季節性樸素法是兩種方法都必須勝過的基準。它將每個小時預測為前一天的同一小時,做法如第 2 章,並套用於總量的歷史資料。它在相同的窗口上計分,並採用相同的尺度。
實用原則: 以各客戶的特徵,根據每個截止時間點之前總量自身的歷史資料直接預測總量,並在決策窗口上選擇目標的縮放方式。兩種方法使用相同的窗口,並各自與總量上的季節性樸素法比較計分。兩種方法都要報告,而不只報告自己所建構的那一種。
此部分尚未翻譯,因此以英文呈現。
Compare the two totals
On the four decision windows, the bottom-up total has the lower error, so it is the method chosen. Those windows are Chapter 5's four ordinary days before the held-out week, used only to choose: Nov 25, Nov 26, Dec 2 and Dec 3, 2014. Chapter 6 chose the client identifier on the same days. Each method is scored by MAE on the total, and bottom-up's MAE there is 1267.47 kWh, against 1678.62 kWh for the direct total. The example refuses to run if a decision hour falls on a Portuguese holiday, and it counts 0 such hours.
The standard cutoffs, Dec 29 to Dec 31, 2014, are the report. They are not used to choose. On these three windows the total has 72 scored hours. Its MASE scale is the mean absolute change between readings a day apart, taken over every reading before Dec 29, 2014, with the clock-change hours masked. That is the rule for a MASE scale from Chapter 2, as Chapter 6 applies it to each client, here applied to the total, and it comes to 2689.26 kWh.
| Method | MAE (kWh) | MASE |
|---|---|---|
| Seasonal naive | 3639.41 | 1.35 |
| Bottom-up | 2985.88 | 1.11 |
| Direct | 3423.11 | 1.27 |
MAE and MASE rank the methods alike here. MAE is in kilowatt hours, so it reads as the average cost of an hour's error. MASE divides each error by the same scale, so on one series it is only a constant multiple of MAE. Its use is across series. Chapter 6 needs it to compare clients of very different sizes, and the total sits beside them on the same footing.
On the standard cutoffs the direct total beats seasonal naive on the total, but by a smaller margin than the bottom-up total does, as the MASE column of the table shows.
A method wins on the decision windows when its error is lower there, and the standard cutoffs then either confirm that or contradict it. For the total, the standard cutoffs confirm the choice, since bottom-up is lower on both window sets. That agreement is why the chapter recommends bottom-up for the total, with some confidence. Agreement counts only when the two sets are separate, and they are. The four decision windows all fall before Dec 25, 2014, the first day of the held-out week, and the standard cutoffs are the last three days of that week. No decision reads a standard cutoff.
The identifier is where the two window sets disagree. On the decision windows, the bottom-up total without the identifier has an MAE of 1383.29 kWh, against 1267.47 kWh with it, so the identifier lowers the total's error there, as the per-client MASE in Chapter 6 does on the same windows. On the standard cutoffs the plain total has an MAE of 2837.66 kWh, and the total with the identifier has 2985.88 kWh. The standard cutoffs therefore favour the plain total. The book reports that and does not act on it, because Chapter 6 kept the identifier on per-client MASE, and the decision windows are the ones that choose. A supplier that doubts four decision windows should add decision windows before Dec 25, 2014, and decide again on those, not on the standard cutoffs.
Working rule: Choose a method on the decision windows, by the measure you will report. Report the same measure on the standard cutoffs beside seasonal naive, with the scored hours and the scale. When two window sets disagree, report both, say how far apart they are, and do not pick the one that reads better.
依占比拆分總量
由上而下的拆分以直接預測的總量為起點,再分給每位客戶一個占比。客戶的占比,是該客戶在自身歷史(截止點之前的 1,344 小時)內的讀數,除以總量在同一段時間內的讀數。每位客戶在某一小時的由上而下預測,等於直接預測的總量在該小時的預測值乘以其占比。過去 8 週提供了總量十分之一的客戶,預期隔天也會占總量的十分之一。
這八週是一項選擇,並非調校出來的數值。這段歷史也是本章其他每個模型所讀取的歷史,因此拆分使用的記憶長度與各客戶的模型相同。較短的視窗能更快反映客戶占比的變化,但雜訊也較大。本章並未衡量這項取捨。需要這項資訊的供應商,應在決策視窗上進行測試。
拆分的弱點在於一天的形狀。它讓每位客戶都套用總量的每日曲線,因此尖峰出現在不同時段的客戶,無論總量預測有多準,每個小時都會得到錯誤的曲線。在這些客戶身上,即使手上握有真實的總量,拆分仍然表現較差。本章稱為 oracle 檢查的做法,是把占比套用到實際的總量上,而這是任何預測都無從得知的;其各客戶平均 MAE 為 171.80 kWh。這只是參考值,而非一種方法:它代表總量完全正確時,拆分本身會有的誤差。必須逐一預測每位客戶的由下而上預測,其各客戶平均 MAE 為 122.81 kWh。
占比也並不均勻。在第一個截止點 2014 年 12 月 29 日,最大客戶占總量的比例為 0.56。
定義 MinT 的工作論文引用 Hyndman 等人(2011)指出,即使基礎預測沒有偏誤,由上而下的拆分仍會使各層級的協調後預測產生偏誤(Wickramasuriya, Athanasopoulos and Hyndman, 2017)。本章不重新推導這項結果,而是在這些客戶上衡量拆分的表現,oracle 檢查則提供了拆分自身誤差的參考。
逐一客戶、在相同視窗上將拆分與由下而上比較,可以看出拆分是否對任何單一客戶較佳,這是平均值無法呈現的。第二個範例做的就是這件事,並對占比執行洩漏檢查。它先在決策視窗上做出選擇,再報告標準截止點的結果。
1"""Splits the direct total forecast into client forecasts, each client taking its share of the history before each cutoff2(top-down), and compares them with bottom-up on the same windows. The point rests on the mean per-client MASE and MAE lines;3the last line is a leak check that no share reads a reading after its cutoff."""4import pandas as pd56from lib.electricity import load7from lib.panel import ALL30, DECISION_CUTOFFS, check_decision_hours8from lib.settings import EVAL_CUTOFFS, show9from lib.totals import SPLIT_METHODS, client_mae, oracle_split_mae, shares, split_checks, split_scored1011raw = load(ALL30)12dec, cut = pd.to_datetime(DECISION_CUTOFFS), pd.to_datetime(EVAL_CUTOFFS)1314# the third value, the hours the top-down clients don't add up to the direct total (none, by construction), is unused15dec_scored, dec_per, _ = split_scored(raw, dec)16show("decision holiday hours", check_decision_hours(dec_scored))17show("mean per-client MASE bottom-up, decision windows", dec_per["bottom-up"].mean())18show("mean per-client MASE top-down, decision windows", dec_per["top-down"].mean())19show("chosen client method", dec_per.mean().idxmin())2021# the third value is discarded, as above22scored, per_client, _ = split_scored(raw, cut)23show("scored hours", len(scored))24mae = pd.DataFrame({m: client_mae(scored, m) for m in SPLIT_METHODS})25for model in SPLIT_METHODS:26 show(f"mean per-client MAE {model}", mae[model].mean())27for model in SPLIT_METHODS:28 show(f"mean per-client MASE {model}", per_client[model].mean())29show("clients where top-down has the lower MAE", int((mae["top-down"] < mae["bottom-up"]).sum()))30# the split applied to the actual total: a reference, since no forecast can know the total in advance31show("mean per-client MAE with the true total split by share", oracle_split_mae(raw, cut))32# the first standard cutoff, Dec 29, 2014; its shares read only the history before it33# shares read the 1,344 hours (8 weeks) before the cutoff34show("largest client share of the total, first cutoff", shares(raw, cut[0]).max())35# each cutoff's readings from the cutoff on replaced by zero, then by a very large value36for label, value in split_checks(raw, cut).items():37 show(label, value)
python total-split-by-share.pydecision holiday hours: 0
mean per-client MASE bottom-up, decision windows: 0.75
mean per-client MASE top-down, decision windows: 2.37
chosen client method: bottom-up
scored hours: 2160
mean per-client MAE bottom-up: 122.81
mean per-client MAE top-down: 218.95
mean per-client MASE bottom-up: 0.91
mean per-client MASE top-down: 2.59
clients where top-down has the lower MAE: 0
mean per-client MAE with the true total split by share: 171.80
largest client share of the total, first cutoff: 0.56
shares changed after poisoning readings from their cutoff: 0
在決策視窗上,由下而上對客戶較佳,各客戶平均 MASE 為 0.75,由上而下則為 2.37,因此選擇由下而上。
在標準截止點上,拆分以千瓦時計的誤差也較差。在 2160 個客戶小時中,其各客戶平均 MAE 為 218.95 kWh,由下而上則為 122.81 kWh;三十位客戶中,由上而下的 MAE 較低者有 0 位。
由上而下的各客戶平均 MASE 為 2.59,由下而上則為 0.91。第 6 章對相同預測的彙總 MAE 為 122.81 kWh,與由下而上的平均值 122.81 kWh 相同。這並非巧合,因為每位客戶都有相同的 72 個評分小時,所以各客戶誤差的平均值等於彙總誤差。
沒有任何占比移動。占比只能讀取截止點之前的歷史,因此洩漏檢查會把每個截止點起的所有讀數改動,一次改為零,一次改為極大的值,然後重新計算占比。在六組比較(三個截止點乘以兩種數值)中,有 0 組改變了占比。若有任何占比讀取了截止點之後的讀數,極大的值就會進入該占比。占比總和為 1,由上而下的各客戶在每個小時加總後等於直接預測的總量,這是由建構方式決定的。這類恆等式不可能失敗,因此本章只計入洩漏檢查,它是這裡唯一可能失敗的測試。
實用原則: 只有在作為基準,或客戶的每日曲線相似時,才依占比拆分總量。每個占比都由截止點之前的歷史計算,並檢查截止點之後的讀數改變時沒有任何占比移動,再以相同尺度將每位客戶與由下而上比較。只有在決策視窗上勝出時,才對該客戶保留拆分。
此部分尚未翻譯,因此以英文呈現。
What goes wrong in production
Most failures in this chapter are silent.
The first is a quietly short total. If one client drops out of the sum, the total is smaller than the demand, and its scores still look reasonable. The bottom-up total in this book raises an error when an hour has fewer than thirty client forecasts. The start rule refuses a client with too little history instead of skipping it, as Chapter 6 explains. In production, a run that builds fewer forecasts than clients should stop and name the missing client.
The second is the raw sum. The October repeat hour holds the energy of two (Chapter 3), so a total built from raw readings can count that hour at roughly twice its neighbours. The result is a demand spike that is not there. The book's total masks the hour instead, and the check in the first example excludes the clock-change hours for the same reason.
The third is a split that reads the future. A split whose shares use the window's own readings scores better in a backtest than it will in production. The poisoning check is the test. A share must not move when readings after its cutoff change. A production run should keep both checks, the share check in the second example and the scale check in the first, as tests that fail loudly.
The fourth is a decision and a report that disagree. The identifier lowers the total's error on the decision windows and raises it on the standard cutoffs. A monitor that watches only one set of windows will miss the other's failure. On every refit, log the total's error with and without the identifier on the same windows, beside the per-client MASE that Chapter 6 uses to decide.
The fifth is a share that goes stale. A share is a fact about the past 8 weeks, so when a client's habits change, its share lags the change for as long as the window is long. A top-down forecast of that client is then wrong in a steady direction, not at random, and the error does not show in the total at all, because the shares still add to one. A monitor should therefore watch each client's share over time, not only the total's error. The per-client MASE in the second example is the measure that sees it.
The sixth is a scale that moves with the window. The total's MASE scale is read once, from the history before the first scored cutoff. A scale refreshed for each window reads that window's own readings, and every score on the total then changes for reasons that have nothing to do with the forecast. The first example checks, for each scored cutoff, that the scale for that window does not move when readings from the cutoff on are replaced. No scale moves: 0 of the six comparisons (three cutoffs by two values) changes it.
Working rule: In production, check the total against the sum of its readings on every refit, stop when a client is missing from a total, and run the poisoning check on each share and on the scale for each window. Log the total's error with and without the identifier on the same windows. When the windows disagree, report both and do not choose the one that flatters the model.
本章的決策
- 總量是
ALL30的逐小時加總。 每個客戶在加總之前,先依起始規則裁切;只要有任何一個客戶在某個小時的讀數被遮蔽為時鐘變更時段,該小時便視為缺值。加總結果不會隨起始規則而改變,第一個範例中的檢查可以證明這一點。 - 每個預測小時都有數值,而評分會拒絕被遮蔽的小時。 輸出的時間格線在時鐘變更時段也是完整的,缺漏的讀數絕不會被當成零來評分。
- 兩種總量都在 pandas 中以手工建構。 此階層只有一層,因此每條路徑都只是一次加總或一次分拆。
hierarchicalforecast與 MinT 只是點名提及,兩者都沒有使用。 - 總量以由下而上的方式預測。 在四個決策窗口與標準截止點上,它的 MAE 都較低。直接預測的總量則並列呈報。
- 直接預測之總量的目標值不做縮放。 在決策窗口上,這種做法的 MAE 較低,因此直接預測模型不像客戶所用的模型那樣縮放目標值。第一個範例會印出兩種設定。
- 識別碼保留在由下而上的總量中,一如第 6 章對客戶所做的決定。 這項決定在標準截止點上對總量造成的代價已在前文呈報,並未撤回。
- 分拆並非客戶所用的方法。 在決策窗口上,由下而上的每客戶 MASE 較低;在這些客戶上,即使使用真實的總量,分拆仍然較差。
- 占比取自每個截止點之前的 1,344 小時,與客戶所用的歷史相同。 汙染檢查顯示,沒有任何占比讀取了較晚的讀數。
- 總量的 MASE 尺度沿用第 2 章的規則,並套用於總量: 取第一個被評分的截止點之前所有讀數的季節性單純預測誤差,其中時鐘變更時段予以遮蔽,且先對每個客戶套用起始規則。
- 窗口沿用第 6 章的設定。 決策窗口與標準截止點是相同的日子,因此兩章的數字可以逐行比較。
- 第 8 章接收點預測: 每個客戶與總量的由下而上預測,並以直接預測的總量作為替代方案。總量的區間無法由各客戶的區間建構出來。
本章,於本版次中
版次 2026.11.11範例於 2026年11 月 20 通過測試本章 2 個範例 個範例中有 2 個通過
譯自英文書,版次 2026.11.11。