I'm working on a company project which I will need to do data partition into 3 parts - Train, Validation, and Test(holdout).
Does anyone know how I can split the data into 3 parts above and each part will have similar response variable(target rate) - (similar accuracy for classification and similar mean of (response) for regression.
I know how to split data into 3 parts by using train_test_split function from SKLEARN
from sklearn.model_selection import train_test_split
x, x_test, y, y_test = train_test_split(xtrain,labels,test_size=0.2,train_size=0.8)
x_train, x_cv, y_train, y_cv = train_test_split(x,y,test_size = 0.25,train_size =0.75)
But this does not give a similar target rate, can someone help me?