时序数据如何划分训练集:避免信息从未来流回来
随机打乱并非总是合适
金融时间序列通常存在相关性、状态变化和重叠窗口。将所有日期随机打乱后分成训练集与测试集,可能让模型在训练阶段间接看到测试期附近的信息。若实际使用场景是用过去预测未来,验证过程也应尽量保持这一时间顺序。
预处理同样需要隔离
标准化、缺失值填补、特征筛选和降维都应只在训练数据上拟合,再把学到的规则应用到验证数据。先对全量数据计算均值和标准差,再切分样本,已经让未来分布参与了过去的处理,即使模型本身没有直接读取未来标签。
例如用过去二十天数据预测未来五天收益,相邻样本的标签区间会大量重叠。划分边界附近的训练标签可能延伸到验证期,应根据标签的实际覆盖区间排除重叠样本,必要时留出隔离区间,而不是机械套用一个固定天数。
验证集和最终测试集承担不同任务
验证集可以帮助选择参数,但反复根据同一验证结果修改模型,会逐步适应这段历史。最终测试集应在研究方案基本确定后才使用,并记录使用次数。若测试结果被用于继续调参,这段数据就不再是独立的最终检验。
多资产模型还需检查同一事件或同一公司是否以不同形式跨集合出现。按日期分组切分通常比逐行随机切分更接近真实场景,但具体方法仍取决于预测对象、持有期和部署频率。所有边界应保存为可复用的日期清单。
报告模型效果时,应同时给出各时间窗口结果和分布变化情况,避免只展示一个总体平均值。合理划分数据不能保证未来有效,却能减少明显的信息泄漏,使后续讨论集中于策略是否具有稳定解释与可实现的交易条件。
-
WATCH: Viral Thanksgiving story set to be adapted for small screenU.S. forces disable vessel that tried to breach blockade of Iranian portsIowa detonation did not increase levels of lead in water, EPA saysMacy's Thanksgiving Day Parade brings out crowds after being postponedIs Alice Huang a spy or not?Somali American Uber driver dies after brutal attack in MinneapolisIowa detonation did not increase levels of lead in water, EPA says48 Hours show schedule20 Best Black Friday Headphone Deals (2026): Up to 57% OffSpain's election could bring the far-right to power for 1st time in decades
下一篇:Trump-backed World Liberty Financial blames Binance after crypto token falls more than 50%
- ·Best Black Friday Espresso Machine Deals: Up to 38% Off (2026)
- ·Macy's Thanksgiving Day Parade held in New York City after weather delay
- ·At least 10 killed across Ukraine; Russia downs over 1,200 drones overnight
- ·Putin's war with Ukraine shows no signs of slowing down despite Trump's efforts
- ·This new sports app is designed specifically for women’s sports
- ·OpenAI countersues Apple over allegations of stealing trade secrets
- ·College student finds golf ball-sized brain tumor: There's no way
- ·Father and son detectives team up to solve haunting cold case murder
- ·I Found the Best Black Friday Deals on Phones (2026): iPhone, Pixel, and Moto Up to 50% Off
- ·OpenAI countersues Apple over allegations of stealing trade secrets
- ·Iowa detonation did not increase levels of lead in water, EPA says
- ·Father and son detectives team up to solve haunting cold case murder
- ·Is Alice Huang a spy or not?
- ·Investigators team up to solve mystery of missing Iowa teen
- ·U.S. forces disable vessel that tried to breach blockade of Iranian ports
- ·OpenAI countersues Apple over allegations of stealing trade secrets
- ·Want to buy your kid an AI toy this Christmas? Not in New York
- ·Many Americans finding inventive ways to save on grocery costs
- ·Iowa detonation did not increase levels of lead in water, EPA says
- ·Southern California rattled by magnitude 5 earthquake
- ·给 AI 编码智能体装上知识库,反而更费 Token?JioHotstar 测完六种方案,文件搜索依然能打
- ·San Francisco charity marks 50 million meals served amid growing need
- ·Saudi and Houthi forces continue to trade strikes
- ·U.S. forces disable vessel that tried to breach blockade of Iranian ports
- ·瞄准“走偏”与“健忘”两道难题:蚂蚁灵波发布两大模型,补齐机器人空间导航能力
- ·Thousands still without power after Thanksgiving storms
- ·Saudi Arabia shifts Vision 2030 spending amid economic and security pressure
- ·11/28: CBS Weekend News
- ·At least 10 killed across Ukraine; Russia downs over 1,200 drones overnight
- ·48 Hours show schedule
- ·The Best Black Friday Deals of 2026: Deepest Discounts on Our Editor's Favorite Gadgets
- ·How apps are helping Americans save money on groceries by finding discounts online
- ·OpenAI countersues Apple over allegations of stealing trade secrets
- ·Macy's Thanksgiving Day Parade held in New York City after weather delay
- ·This new sports app is designed specifically for women’s sports
- ·2 American Airlines jets clip wings on tarmac of Reagan Airport
