X_train,test_df,y_train,y_test = train_test_split(result,y_true,stratify = y_true,test_size = 0.2)
在上面使用train_test_split的示例中,result
是数据帧,y_true
是从数据帧的目标类列形成的numpy数组。
我的问题是,如果我们已经分别给出“ y_true”,为什么我们将整个“结果”数据帧作为train_test_split中的输入参数之一?我的意思是,我们不应该首先从“结果”数据框中排除目标类列吗?