0
$\begingroup$

My objective is to predict the sales 6 weeks in advance. I have data that from 01-Jan-2013 to 31-June-2015. I am supposed to predict the sales from 01-Aug-2015 to 17-Sept-2015 using machine learning. I was trying to develop a method to cross validate. this is the way I split the data:

 -----------------------------------------------
|        |  training          |     Testing     |
 -----------------------------------------------
|  fold  |  year  |  months  |  year  |  months | 
|  1     |  2013  |  4,5,6   |  2013  |  7,8    |
|  2     |  2013  |  9,10,11 |  2014  |  12,1   |
|  3     |  2014  |  2,3,4   |  2014  |  5,6    |
|  4     |  2014  |  7,8,9   |  2014  |  10,11  |
|  5     |  2015  |  12,1,2  |  2015  |  3,4    |
 -----------------------------------------------

Is this the proper way to do it?

$\endgroup$
0
$\begingroup$

First, you confuse test set with cross-validation set. Test set is used to measure performance of a model AFTER you select your best model based on different model performance, measured on cross-validation set. And about splitting your data I would suggest the following:

 -----------------------------------------------
|        |  training          |     Testing     |
 -----------------------------------------------
|  fold  |  year  |  months  |  year  |  months | 
|  1     |  2013  |  4,5,6   |  2013  |  7,8    |
|  2     |  2013  |  7,8,9   |  2014  |  10,11  |
|  3     |  2014  |  10,11   |  2014  |  12,13  |
 -----------------------------------------------

The idea is to use monthly data both as input and output (target value) since that way you will have more data to train your model.

| cite | improve this answer | |
$\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.