3
$\begingroup$

Most of the blogs mention about a good thumb rule to be 80-20 split for the train and test respectively.

My special case is a time series dataset and it is for the stock prices, which IMO is very time sensitive.

Question? Why can we not have a 99-1 train test split, for the model to learn all the information and time trends. Since my prediction will be in the future I will be ever increasing my test data set. I am using a neural network (rnn-lstm) for my prediction.

I am aware about cross_validation, froward_chaining which are better ways to train a time series dataset.

$\endgroup$
  • 2
    $\begingroup$ We create a test dataset to know how better our model could perform on unseen data. You can use a 99-1 split but the model will be evaluated on less unseen samples. $\endgroup$ – Shubham Panchal Sep 22 '19 at 0:59
4
$\begingroup$

The idea of splitting 80%-20% is to use as much data as possible for training while keeping enough (labeled) data in the test set in order to reliably evaluate the performance. It's fine to use a smaller test set if it's big enough, but if it's too small the evaluation might not reflect the real performance of the model.

Your idea of using future test data is fine, it simply means that the reliable evaluation is delayed until you obtain enough test data. In the meantime you cannot be sure that your model performs well, so I would avoid using it for real trading on the stock exchange ;)

$\endgroup$
1
$\begingroup$

The 80-20 split is just a heuristic.

If you want to be precise about it, you can analyse it statistically. Say you have a 0-1 classifier, and you expect the accuracy to be around $\delta\in[0,1]$, then it's not too hard to show that you need $k=1/(\delta \epsilon^2)$ test samples to measure you accuracy up to a factor $1\pm\epsilon$.

This means that if your amount of data is much larger than $k$, you can use much more uneven split. If you don't even have $k$ samples, then you're not going to get a precise result, and all you can do is consider methods such as cross validation.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.