简体   繁体   English

如何在不使用 function train_test_split 的情况下将数据拆分为测试和训练?

[英]How can I split the data into test and train without using function train_test_split?

i am currently working on timeseries forecasting, and I have to split the data into a training set and a test set.我目前正在进行时间序列预测,我必须将数据分成训练集和测试集。 (Have the first 70% of the data be in the training set) (让前 70% 的数据在训练集中)

However, i cannot use the train_test_split function because it will shuffle the rows.但是,我不能使用 train_test_split function 因为它会洗牌。 How else I can split the data我还能如何拆分数据

You can actually use train_test_split, but setting shuffle = False您实际上可以使用 train_test_split,但设置shuffle = False

https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不使用train_test_split()的情况下拆分数据集? - How to split the data set without train_test_split()? 我们如何将显式测试数据和训练数据提供给 SVM 而不是使用 train_test_split 函数? - How can we give explicit test data and train data to SVM instead of using train_test_split function? 如何使用train_test_split将未标记的数据拆分为训练集和测试集? - How to split unlabeled data into train and test set using train_test_split? 如何使用 train_test_split 拆分元组? - How to split a tuple using train_test_split? 如何使用 sklearn 中的 train_test_split 确保用户和项目同时出现在训练和测试数据集中? - How can I ensure that the users and items appear in both train and test data set with train_test_split in sklearn? 如何使用 Python Numpy 中的 train_test_split 将数据拆分为训练、测试和验证数据集? 分裂不应该是随机的 - How to split data by using train_test_split in Python Numpy into train, test and validation data set? The split should not random 带有test_size = 0的train_test_split如何影响数据? - How is train_test_split with test_size=0 affecting the data? 用 numpy 编写一个 train_test_split 函数 - writing a train_test_split function with numpy 修改train_test_split函数 - Modifying train_test_split function train_test_split 不拆分数据 - train_test_split not splitting data
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM