# Should we always use the usual no leakage train-val-test splt in time series?

Some of you may be familiar with the unusual split scheme used for time-series data. In short, there is a saying that one should only consider a split where the training set comes prior to the testing set (in terms of index or timedate), as otherwise we essentially use future data to infer.

Namely, given the dataset $$\mathcal{D}=\{(x_1,y_1),...,(x_n,y_n)\}$$, a viable split may look like \begin{align} train=\{(x_1,y_1),...,(x_j,y_j)\}\subseteq\mathcal{D}\\ test=\{(x_{j+1},y_{j+1}),...,(x_k,y_k)\}\subseteq\mathcal{D} \end{align} for some $$j\leq k\leq n$$

My question is - are there some cases where random splitting is O.K in time series? Also, what is the main problem with random sampling?

• Please clarify what you mean by 'random splitting'. It sounds like you want to choose j randomly. The standard practice is to split data with 80% for training and 20% for testing. When the data has a low number of observations many people will choose 90% for training and 10% for testing. Dec 31, 2022 at 23:54
• random as in k fold, for example Jan 1 at 0:01