Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

時系列予測の性能検証

Back-testing

同じデータセットで訓練と評価を行うこと(train error)

性能を過大評価しがち

Walk forward testing

test setはtrain setより新しい時間軸のデータを使う。

Scikit-learnのTimeSeriesSplitみたいなやつ。

data_period = [1, 2, 3, 4, 5, 6]

Fold 0:
  Train: index=[0]
  Test:  index=[1]
Fold 1:
  Train: index=[0 1]
  Test:  index=[2]
Fold 2:
  Train: index=[0 1 2]
  Test:  index=[3]
Fold 3:
  Train: index=[0 1 2 3]
  Test:  index=[4]
Fold 4:
  Train: index=[0 1 2 3 4]
  Test:  index=[5]

pros:

  • back-testingのような過大評価をする可能性は低め

cons:

  • サンプル数が少なくなりがち

Combinatorial Purged Cross-Validation (CPCV)

組み合わせパーシング交差検証(Combinatorial Purged Cross-Validation: CPCV)

  • MCK_M C_K通りのtrainとtestの組み合わせにする

  • データセットの部分集合の数をMMとすると、そのうちKK個をtest setにする

pros:

  • metricsのサンプル数を増やせる