train_test_split中的数据类型
时间: 2023-08-24 17:12:46 浏览: 116
train_test_split_cub.py
train_test_split函数中的数据类型可以是numpy数组、pandas DataFrame或其他可迭代的数据结构。\[1\]在引用的示例中,X是一个numpy数组,y是一个range对象。train_test_split函数将这些数据划分为训练集和测试集,并返回划分后的数据。在示例中,X_train和X_test是划分后的训练集和测试集的特征数据,y_train和y_test是对应的标签数据。\[3\]
#### 引用[.reference_title]
- *1* *2* [train_test_split--切分训练和测试数据的方法参数介绍](https://blog.csdn.net/hzp666/article/details/127883467)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [sklearn中train_test_split详解(数据集划分为训练集与测试集)](https://blog.csdn.net/weixin_43135178/article/details/126417323)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文