Apr-30-2018, 01:48 PM
Hi,
I have a dataset and I want to split it into trainSet and testSet in the specified size. I use the below function to split but it is splitting randomly, but I want to split continuously:
X_train,X_test,Y_train,Y_test=train_test_split(x,y,test_size=0.2,random_state=0)
if my dataSet as below:
1 2 3
2 4 5
3 2 5
4 5 9
5 6 9
6 1 0
7 5 6
8 0 2
9 7 0
10 1 2
I want to split it into Trainset (80%) and testSet(20%)
My desired TrainSet:
1 2 3
2 4 5
3 2 5
4 5 9
5 6 9
6 1 0
7 5 6
8 0 2
testSet:
9 7 0
10 1 2
Can anyone kindly help how to this,
I have a dataset and I want to split it into trainSet and testSet in the specified size. I use the below function to split but it is splitting randomly, but I want to split continuously:
X_train,X_test,Y_train,Y_test=train_test_split(x,y,test_size=0.2,random_state=0)
if my dataSet as below:
1 2 3
2 4 5
3 2 5
4 5 9
5 6 9
6 1 0
7 5 6
8 0 2
9 7 0
10 1 2
I want to split it into Trainset (80%) and testSet(20%)
My desired TrainSet:
1 2 3
2 4 5
3 2 5
4 5 9
5 6 9
6 1 0
7 5 6
8 0 2
testSet:
9 7 0
10 1 2
Can anyone kindly help how to this,