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

Astral to Join OpenAI
Dev.to

I Built a MITM Proxy to See What Claude Code Actually Sends to Anthropic
Dev.to

Your AI coding agent is installing vulnerable packages. I built the fix.
Dev.to

ChatGPT Prompt Engineering for Freelancers: Unlocking Efficient Client Communication
Dev.to

PearlOS. We gave swarm intelligence a local desktop environment and code control to self-evolve. Has been pretty incredible to see so far. Open source and free if you want your own.
Reddit r/LocalLLaMA