sc_f = sc27.tocsr()
X, y = sc_f
X_train,X_test, y_train, y_test = train_test_split(sc_f, y, stratify=y, test_size=0.3)
I was getting error while splitting the sparse matrix to a Train and Test. How to split the array into train and test?
sc_f: scipy sparse matrix
I want to split it in such a way so that in y I have the target i.e 'is_true' which I want to predict and it takes only two values 0 and 1. When I'm converting my scipy sparse matrix to sparseDataFrame. I'm not able to access it as df['is_true'] where df is the sparseDataFrame. How do I split it. Can anyone help?