How to split the training and test set for repeated measure data

Hello,

How to split the training and test set for performing SPLS-DA? I have 23 subjects and samples collected from each for 5 time points. Should I use withinvariation(X, design) and then split the data? What would be the correct approach?

Thanks!