05_競馬データ(時系列)にKFoldを使うとリークが起きる理由
Qiita / 3/17/2026
💬 OpinionIdeas & Deep AnalysisTools & Practical Usage
Key Points
- 時系列データではKFoldのランダム分割が将来情報のリークを招く可能性があり、訓練データと検証データの境界で情報が共有され得る。
- 競馬データのように過去のレース結果や日付に依存する特徴を含む場合、時系列を無視したクロスバリデーションは現実の予測性能を過大評価させるリスクがある。
- 推奨される手法は時系列に沿った分割(時間順序を守る分割)やローリング Origin( expanding/rolling window)など、未来データを訓練に含めない分割方法を用いること。
- 特徴量設計時には「未来情報を含むテールデータ」や「直近の結果を未来ラベル前提で使う設計」がリークの原因にならないよう留意する。
はじめに
機械学習の入門書では「クロスバリデーション(KFold)でモデルを評価しよう」と教えられます。しかし、競馬データのような時系列データに通常のKFoldを使うと、未来のデータで過去を予測するという情報リークが発生し、モデルが過大評価されます。
この記事では、時系...
Continue reading this article on the original site.
Read original →Related Articles

I built an autonomous AI Courtroom using Llama 3.1 8B and CrewAI running 100% locally on my 5070 Ti. The agents debate each other through contextual collaboration.
Reddit r/LocalLLaMA
The Honest Guide to AI Writing Tools in 2026 (What Actually Works)
Dev.to
The Honest Guide to AI Writing Tools in 2026 (What Actually Works)
Dev.to
AI Cybersecurity
Dev.to
The Wave of Open-Source AI and Investment in Security: Trends from Qwen, MS, and Google
Dev.to