目錄

1140923 meeting

本週使用 Weather2K 資料集。經整理,此資料集內並無缺失,其資料日期為 2017 年 1 月至 2021 年 8 月止,紀錄頻率為每 3 小時,共計 13,632 個時間點資料,同時包含 2,130 個觀測站資料,且採用中國標準時間(CST,UTC+8)。此資料集之資料來源為中國中央氣象局(CMA)地面氣象站的觀測資料,並遵循《地面氣象觀測規範—通則》(GB/T 35221-2017)以及《地面氣象觀測資料質量控制》(QX/T 118-2010)之標準收集原始數據。

原始論文表示,完整資料集代號為 Weather2K-N ,包含完整的的氣象站資料,出於保密原因並未發布;開源的資料集為 Weather2K-R ,以 Numpy 檔案格式儲存,形狀為 (1866, 13, 13632) ;此外,此論文還提供了一個特殊版本 Weather2K-S ,包含分布於不同地區的 15 個代表性氣象站,並以 CSV 格式文件儲存。

本次使用的資料集為 Weather2K-R ,其儲存之變數如下:

Numpy IndexLong NameShort NameUnit
0Latitudelat(°)
1Longitudelon(°)
2Altitudealt(m)
3Air pressureaphpa
4Air Temperaturet(°C)
5Maximum temperaturemxt(°C)
6Minimum temperaturemnt(°C)
7Relative humidityrh(%)
8Precipitation in 3hp3(mm)
9Wind directionwd(°)
10Wind speedws(ms-1)
11Maximum wind directionmwd(°)
12Maximum wind speedmws(ms-1)

經簡單資料整理後,得到如下資訊:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
shape = data_train_known_real.shape
data_slice = data_train_known_real.reshape(shape[0], shape[1] * shape[2])
df = pd.DataFrame(data_slice)

summary_df = pd.DataFrame({
    'min': df.min(axis=1),
    'max': df.max(axis=1),
    'range': df.max(axis=1) - df.min(axis=1),
    'mean': df.mean(axis=1),
    'median': df.median(axis=1),
    'std': df.std(axis=1),
    'nan_count': df.isna().sum(axis=1),
    'mode': df.mode(axis=1).iloc[:, 0]
})

row_names = [
    'Air pressure (ap, hpa)',
    'Air Temperature (t, °C)',
    'Maximum temperature (mxt, °C)',
    'Minimum temperature (mnt, °C)',
    'Relative humidity (rh, %)',
    'Precipitation in 3h (p3, mm)',
    'Wind direction (wd, °)',
    'Wind speed (ws, ms^-1)',
    'Maximum wind direction (mwd, °)',
    'Maximum wind speed (mws, ms^-1)'
]

summary_df.index = row_names
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)

print(summary_df)
Variableminmaxrangemeanmedianstdnan_countmode
Air pressure (ap, hpa)567.51041.4473.9944.072875980.283.67683801002.0
Air Temperature (t, °C)-17.545.362.818.89405919.88.623656024.6
Maximum temperature (mxt, °C)-16.846.162.919.37924020.38.620829024.8
Minimum temperature (mnt, °C)-17.744.762.418.41739219.306258.613370024.6
Relative humidity (rh, %)0.0100.0100.067.37217872.024.4579840100.0
Precipitation in 3h (p3, mm)0.0310.8310.80.4255900.02.62402600.0
Wind direction (wd, °)0.0360.0360.0173.129808170.099.1142570185.0
Wind speed (ws, ms-1)0.030.030.02.2553821.81.64502401.1
Maximum wind direction (mwd, °)0.0360.0360.0173.556036170.099.2650780195.0
Maximum wind speed (mws, ms-1)0.048.948.92.9449232.51.83752401.5

本次實驗使用的時間範圍為 2021 年 3 月 5 日 00:00 至 2021 年 7 月 26 日 21:00,共 1152 個時間步,提供模型充分的歷史資訊以捕捉季節性及日變化。

測試期間為 2021 年 7 月 27 日 00:00 至 2021 年 8 月 31 日 21:00,共 288 個時間步,其中 2021 年 8 月 24 日 21:00 至 8 月 31 日 21:00 有 57 個時間步的缺失值,用於對模型的空間填補與時間預測能力提出挑戰。

資料中包含 1492 個已知站點 作為訓練與驗證的基礎,另有 374 個未知站點 需進行預測或補值,實驗範圍涵蓋時序預測與空間插補,旨在評估模型在多站點、多變數環境下的表現。

時間挑選方式為,從原始時間序列抽取固定比例的連續時間段作為訓練與測試資料集,空間測站亦同。

項目訓練測試
起始時間2021 年 3 月 5 日 00:002021 年 7 月 27 日 00:00
結束時間2021 年 7 月 26 日 21:002021 年 8 月 31 日 21:00
時間步1152 個時間步288 個時間步
已知站點數1492 個已知站點1492 個已知站點
未知站點數374 個未知站點374 個未知站點
缺失值期間-2021 年 8 月 24 日 21:00
至 2021 年 8 月 31 日 21:00
共 57 個時間步
1
2
3
4
5
6
7
8
9
# config for time series
time_duration = 1440  # 8 times a day * 30 days * 6 months = 1440
data = data[:, -time_duration:, :]
time_index = time_index[-time_duration:]

# config for split & save
ratio_station_known = 0.8  # ratio of known stations in training set
ratio_time_past = 0.8  # ratio of known stations in training set
ratio_missing = 0.2

此次實驗因各變數尺度過大,故各時間序列均會先進行標準化後再進行訓練。以 RegressionEnsemble 為例,以上變數若全部經時間序列預測與 autoFRK 的空間填補,相對溼度、風向、最大風速風向的平均預測誤差(MSPE)容易出現明顯偏高的情形,故應在後續實驗中移除。

VariableMSPE
Air pressure (ap, hpa)3.729113
Air Temperature (t, °C)4.448267
Maximum temperature (mxt, °C)4.573875
Minimum temperature (mnt, °C)4.289456
Relative humidity (rh, %)127.798885
Precipitation in 3h (p3, mm)6.457359
Wind direction (wd, °)7206.518631
Wind speed (ws, ms^-1)1.279657
Maximum wind direction (mwd, °)7193.734357
Maximum wind speed (mws, ms^-1)1.504698

參考資料

  • Zhu X, Xiong Y, Wu M, et al. Weather2K: A Multivariate Spatio-Temporal Benchmark Dataset for Meteorological Forecasting Based on Real-Time Observation Data from Ground Weather Stations[C]//International Conference on Artificial Intelligence and Statistics. PMLR, 2023: 2704-2722.