0 votes
in Education by (55.6k points)
How to split data into 3 sets (train, validation and test)?

1 Answer

0 votes
by (55.6k points)

You can split your dataset into train,validation and test using the numpy.split() method:

Syntax-

numpy.split(array,indices_or_sections,axis=0)

 

Example-

>>> a= np.arange(9.0)

>>> np.split(a, 3)

[array([ 0.,  1.,  2.]),

 array([ 3.,  4.,  5.]),

 array([ 6.,  7.,  8.])]

...