python - 如何在不使用函数 train_test_split 的情况下将数据拆分为测试和训练?
问题描述
我目前正在进行时间序列预测,我必须将数据分成训练集和测试集。(让前 70% 的数据在训练集中)
但是,我不能使用 train_test_split 函数,因为它会打乱行。我还能如何拆分数据
解决方案
您实际上可以使用 train_test_split ,但设置shuffle = False
https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html
推荐阅读
- mpi - 即使我们有单节点多 GPU 设置,也限制 MPI 在单 GPU 上运行
- kubernetes - 使用 helm install 传递配置、证书和机密的最佳实践
- c# - 如何使用 api c# 从简单的 redmine 中获取所有未解决的问题
- bash - ':在 bash 中不是有效的标识符释放错误消息
- ios - 使用 FCM 时生成证书的正确方法是什么
- r - 如何在 dplyr 中使用 substr 在 R 中选择
- python - AWS API 网关 Lambda 授权程序警告
- google-chrome-extension - 如何从 chrome 网上商店下载原始源代码
- c++ - 带 4K 显示的 QT 布局输出
- svelte - 无法动态加载组件