I am trying to apply KNN to Diabetes prima data, in order to split my data set into training and testing datasets, I have used iloc function as described in the code. But when I am using this code, I am getting really weird test data shapes. Can anyone please explain what am I doing wrong here
here is the code :
# first 8 columns from index 0 to 7 to be used for parameters
X = dataset.iloc[:,0:8]
y = dataset.iloc[:,8]
# lets split X and Y into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(X,y,test_size =0.2,random_state =0)
# let us check the shape of all of these
print("X_train shape is : ", X_train.shape)
print("X_test shape is : ", X_test.shape)
print("y_train shape is : ", y_train.shape)
print("y_test shape is : ", y_test.shape)
This is the output I am getting :
X_train shape is : (614, 8)
X_test shape is : (154, 8)
y_train shape is : (614,)
y_test shape is : (154,)