0
votes

The dataset is divided into training and testing sets using the function train_test_split() in 75:25 ratio.

The model is trained on the data set x_train and y_train.(classifier models like gaussian naive bayes, random forest, k nearest neighous ,etc)

Can we now test the model using the complete data set i.e, x and y? Or should we only use x_test and y_test for testing the model?

1
you should use only the test data for measuring the generalisation error.Venkatachalam

1 Answers

1
votes

train_test_split() is meant to give you a simpler way of creating training and test subsets from your original dataset. x_train and y_train both represent training data and target data, useful to train a model like the ones mentioned to finally test on the test subsets.

this is for training, i.e. practice. testing on the entire dataset is wrong, because your model will crearly be biased on data it was trained on from x_train y_train. you should test your models on never-before-seen y_test data