where might you find test data?
the dataset has to be divided into two parts one part is for
training and another is for testing.generally the part which
contains more samples will be considered as training data and the
part which contains less samples will be considered as testing
data.
suppose there is a dataset contains 100 samples
it can be divided as 75 samples for training and the remaining for
testing.
there is a method in sklearn to split the train and test data in
the desired ratio
it can be done as
from sklearn.model_selection import train_test_split
x_train,x_test,y_train,y_test =
train_test_split(x,y,test_size=1/4,random_state=0)
x - input set of our data
y - output set of our data
test_size - the ratio in which the dataset has to be divided for
training and testing.
If you have any doubts please comment and please don't dislike.
Get Answers For Free
Most questions answered within 1 hours.