1
$\begingroup$

Say I have a time-series data frame for a bank that records number of cases filed for 16 districts as below (cases can be for many purposes - loans, credit cards, real estate, etc.):

application_date    branch_id    district    case_count
2017-04-01              1        A           40.0
2017-04-03              1        A           5.0
2017-04-04              1        A           4.0
2017-04-05              1        A           113.0
2017-04-07              1        A           76.0

But if I sort the above data by application_date, like so:

application_date    branch_id    district    case_count
2017-04-01              1         A           40.0
2017-04-01              62        B           5.0
2017-04-01              63        C           4.0
2017-04-01              64        D           113.0
2017-04-01              65        E           76.0

Considering that branch_id and district are categorical variables, does sorting affect performance of standard ML models like random Forests and gradient boosted models as well as their predictive accuracy?

$\endgroup$
1
$\begingroup$

Sorting data won't affect the training of your model, it is similar to changing the random seed.

It can affect the validation that you are doing. In case you do time series you can do sliding window or roll-out-window, that they need the data to be sorted before the splitting.

It seems that you want to do time series regression with supervised learning so what you probably want to do is change your problem to a supervised learning problem. You can see a bit more here. But this is me guessing what you wnat from a couple lines.

$\endgroup$
  • $\begingroup$ That's right. This is a supervised problem. $\endgroup$ – Shiv_90 Jan 20 at 13:02
  • 1
    $\begingroup$ @Shiv_90 take a look at the link I posted. It might help you to change your problem to a supervised learning one. Let me know if you need more help. $\endgroup$ – Carlos Mougan Jan 20 at 13:16

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.