{
  "id": 588610,
  "title": "The order of the test rows",
  "url": "/competitions/drw-crypto-market-prediction/discussion/588610",
  "author_name": "",
  "post_date": "2025-07-07T13:24:35.753827900Z",
  "votes": 9,
  "comment_count": 8,
  "views": 0,
  "content": "<p>Hi all!</p>\n<p>It seems that the test dataframe was shuffled by the host using <code>random_state=700</code>.<br>\nIf that's the case, you can recover the original order of the test rows.</p>",
  "messages": [
    {
      "id": "3243728",
      "postDate": "07/07/2025 13:24:35",
      "content": "<p>Hi all!</p>\n<p>It seems that the test dataframe was shuffled by the host using <code>random_state=700</code>.<br>\nIf that's the case, you can recover the original order of the test rows.</p>",
      "rawMarkdown": "Hi all!\n\nIt seems that the test dataframe was shuffled by the host using ```random_state=700```.\nIf that's the case, you can recover the original order of the test rows.",
      "votes": null
    },
    {
      "id": "3243749",
      "postDate": "07/07/2025 13:46:27",
      "content": "<p>😱😱😱<br>\nBTW, I am more curious about how you figure out it is the random_state 700</p>",
      "rawMarkdown": "😱😱😱\nBTW, I am more curious about how you figure out it is the random_state 700",
      "votes": null
    },
    {
      "id": "3243761",
      "postDate": "07/07/2025 14:00:10",
      "content": "<p>Even if 700 is true, I don't think you can prove that the train rows have the same period as the test rows.</p>",
      "rawMarkdown": "Even if 700 is true, I don't think you can prove that the train rows have the same period as the test rows.",
      "votes": null
    },
    {
      "id": "3243809",
      "postDate": "07/07/2025 14:35:38",
      "content": "<blockquote>\n  <p>😱😱😱<br>\n  BTW, I am more curious about how you figure out it is the random_state 700</p>\n</blockquote>\n<p>Basically one can do something like (from what I understood <a href=\"https://www.kaggle.com/gromml\" target=\"_blank\">@gromml</a> does something very similar, but checking accuracy?) the following:</p>\n<ul>\n<li>Check correlation between a value and its lagged value for features for let's say the training dataset</li>\n<li>Assume test was shuffled by some random state</li>\n<li>Do the reverse shuffling for random states between 0 and 1000 or similar</li>\n<li>For each reversed version, recompute the correlation between the feature and its lagged version.</li>\n<li>Identify the random state(s) that restore the highest correlation (or most similar to the corresponding correlation on the training dataset), suggesting the most plausible original ordering.</li>\n</ul>\n<p>I tried the above for feature X1 when applied the function <a href=\"https://www.kaggle.com/gromml\" target=\"_blank\">@gromml</a> use in the linked notebook, and it does indeed seem to work.</p>\n<p>That said, I guess it is not allowed since it alters what to optimize for etc. </p>",
      "rawMarkdown": "> 😱😱😱\n> BTW, I am more curious about how you figure out it is the random_state 700\n\nBasically one can do something like (from what I understood @gromml does something very similar, but checking accuracy?) the following:\n\n* Check correlation between a value and its lagged value for features for let's say the training dataset\n* Assume test was shuffled by some random state\n* Do the reverse shuffling for random states between 0 and 1000 or similar\n* For each reversed version, recompute the correlation between the feature and its lagged version.\n* Identify the random state(s) that restore the highest correlation (or most similar to the corresponding correlation on the training dataset), suggesting the most plausible original ordering.\n\n\nI tried the above for feature X1 when applied the function @gromml use in the linked notebook, and it does indeed seem to work.\n\nThat said, I guess it is not allowed since it alters what to optimize for etc.",
      "votes": null
    },
    {
      "id": "3243813",
      "postDate": "07/07/2025 14:43:10",
      "content": "<p>I got Corr of 0.48 by using your unshuffling and building a target so I think you are correct/on the right lines.</p>",
      "rawMarkdown": "I got Corr of 0.48 by using your unshuffling and building a target so I think you are correct/on the right lines.",
      "votes": null
    },
    {
      "id": "3243826",
      "postDate": "07/07/2025 14:58:23",
      "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7192196%2F8baef67548b89775983413f8e61f990f%2Ftime_features.png?generation=1751900256075827&amp;alt=media\" alt=\"\"></p>\n<p>At a fast check I think u are right</p>\n<p>01/03/2024    Friday  2,125<br>\n29/03/2024    Friday  1,8125<br>\n26/04/2024    Friday  2,1875<br>\n31/05/2024    Friday  1,75<br>\n28/06/2024    Friday  1,75<br>\n26/07/2024    Friday  2,1875<br>\n30/08/2024    Friday  1,75<br>\n27/09/2024    Friday  1,75<br>\n25/10/2024    Friday  2,1875<br>\n29/11/2024    Friday  1,75<br>\n27/12/2024    Friday  2,1875<br>\n31/01/2025    Friday  1,75<br>\n28/02/2025    Friday  1,75<br>\n09/03/2025    Friday  </p>\n<p>29 march Good Friday    </p>\n<p>The first 2 periods are deterministic…     </p>",
      "rawMarkdown": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7192196%2F8baef67548b89775983413f8e61f990f%2Ftime_features.png?generation=1751900256075827&alt=media)\n\nAt a fast check I think u are right\n\n01/03/2024\tFriday\t2,125\n29/03/2024\tFriday\t1,8125\n26/04/2024\tFriday\t2,1875\n31/05/2024\tFriday\t1,75\n28/06/2024\tFriday\t1,75\n26/07/2024\tFriday\t2,1875\n30/08/2024\tFriday\t1,75\n27/09/2024\tFriday\t1,75\n25/10/2024\tFriday\t2,1875\n29/11/2024\tFriday\t1,75\n27/12/2024\tFriday\t2,1875\n31/01/2025\tFriday\t1,75\n28/02/2025\tFriday\t1,75\n09/03/2025\tFriday\t\n\t\t\n29 march Good Friday\t\n\nThe first 2 periods are deterministic...",
      "votes": null
    },
    {
      "id": "3243884",
      "postDate": "07/07/2025 16:14:21",
      "content": "<p>Interesting, this really throws into doubt some of the breakaway scores.</p>",
      "rawMarkdown": "Interesting, this really throws into doubt some of the breakaway scores.",
      "votes": null
    },
    {
      "id": "3244263",
      "postDate": "07/08/2025 03:03:35",
      "content": "<p>Are the constructed labels derived from external data</p>",
      "rawMarkdown": "Are the constructed labels derived from external data",
      "votes": null
    },
    {
      "id": "3244426",
      "postDate": "07/08/2025 06:32:38",
      "content": "<p>It's cool, a kind of continuation of <a href=\"https://www.kaggle.com/competitions/drw-crypto-market-prediction/discussion/584485\" target=\"_blank\">https://www.kaggle.com/competitions/drw-crypto-market-prediction/discussion/584485</a> </p>",
      "rawMarkdown": "It's cool, a kind of continuation of https://www.kaggle.com/competitions/drw-crypto-market-prediction/discussion/584485",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3243749,
      "author_name": "shinchen93",
      "author_url": "",
      "post_date": "07/07/2025 13:46:27",
      "content": "<p>😱😱😱<br>\nBTW, I am more curious about how you figure out it is the random_state 700</p>",
      "votes": null,
      "replies": [
        {
          "id": 3243809,
          "author_name": "ern711",
          "author_url": "",
          "post_date": "07/07/2025 14:35:38",
          "content": "<blockquote>\n  <p>😱😱😱<br>\n  BTW, I am more curious about how you figure out it is the random_state 700</p>\n</blockquote>\n<p>Basically one can do something like (from what I understood <a href=\"https://www.kaggle.com/gromml\" target=\"_blank\">@gromml</a> does something very similar, but checking accuracy?) the following:</p>\n<ul>\n<li>Check correlation between a value and its lagged value for features for let's say the training dataset</li>\n<li>Assume test was shuffled by some random state</li>\n<li>Do the reverse shuffling for random states between 0 and 1000 or similar</li>\n<li>For each reversed version, recompute the correlation between the feature and its lagged version.</li>\n<li>Identify the random state(s) that restore the highest correlation (or most similar to the corresponding correlation on the training dataset), suggesting the most plausible original ordering.</li>\n</ul>\n<p>I tried the above for feature X1 when applied the function <a href=\"https://www.kaggle.com/gromml\" target=\"_blank\">@gromml</a> use in the linked notebook, and it does indeed seem to work.</p>\n<p>That said, I guess it is not allowed since it alters what to optimize for etc. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3243761,
      "author_name": "taylorsamarel",
      "author_url": "",
      "post_date": "07/07/2025 14:00:10",
      "content": "<p>Even if 700 is true, I don't think you can prove that the train rows have the same period as the test rows.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 3243813,
      "author_name": "julianmukaj",
      "author_url": "",
      "post_date": "07/07/2025 14:43:10",
      "content": "<p>I got Corr of 0.48 by using your unshuffling and building a target so I think you are correct/on the right lines.</p>",
      "votes": null,
      "replies": [
        {
          "id": 3244263,
          "author_name": "shiweiguo1995",
          "author_url": "",
          "post_date": "07/08/2025 03:03:35",
          "content": "<p>Are the constructed labels derived from external data</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3243826,
      "author_name": "mirko45",
      "author_url": "",
      "post_date": "07/07/2025 14:58:23",
      "content": "<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7192196%2F8baef67548b89775983413f8e61f990f%2Ftime_features.png?generation=1751900256075827&amp;alt=media\" alt=\"\"></p>\n<p>At a fast check I think u are right</p>\n<p>01/03/2024    Friday  2,125<br>\n29/03/2024    Friday  1,8125<br>\n26/04/2024    Friday  2,1875<br>\n31/05/2024    Friday  1,75<br>\n28/06/2024    Friday  1,75<br>\n26/07/2024    Friday  2,1875<br>\n30/08/2024    Friday  1,75<br>\n27/09/2024    Friday  1,75<br>\n25/10/2024    Friday  2,1875<br>\n29/11/2024    Friday  1,75<br>\n27/12/2024    Friday  2,1875<br>\n31/01/2025    Friday  1,75<br>\n28/02/2025    Friday  1,75<br>\n09/03/2025    Friday  </p>\n<p>29 march Good Friday    </p>\n<p>The first 2 periods are deterministic…     </p>",
      "votes": null,
      "replies": [
        {
          "id": 3243884,
          "author_name": "tamareltech",
          "author_url": "",
          "post_date": "07/07/2025 16:14:21",
          "content": "<p>Interesting, this really throws into doubt some of the breakaway scores.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3244426,
      "author_name": "gleb270",
      "author_url": "",
      "post_date": "07/08/2025 06:32:38",
      "content": "<p>It's cool, a kind of continuation of <a href=\"https://www.kaggle.com/competitions/drw-crypto-market-prediction/discussion/584485\" target=\"_blank\">https://www.kaggle.com/competitions/drw-crypto-market-prediction/discussion/584485</a> </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3243728": "Hi all!\n\nIt seems that the test dataframe was shuffled by the host using ```random_state=700```.\nIf that's the case, you can recover the original order of the test rows.",
    "3243749": "😱😱😱\nBTW, I am more curious about how you figure out it is the random_state 700",
    "3243761": "Even if 700 is true, I don't think you can prove that the train rows have the same period as the test rows.",
    "3243809": "> 😱😱😱\n> BTW, I am more curious about how you figure out it is the random_state 700\n\nBasically one can do something like (from what I understood @gromml does something very similar, but checking accuracy?) the following:\n\n* Check correlation between a value and its lagged value for features for let's say the training dataset\n* Assume test was shuffled by some random state\n* Do the reverse shuffling for random states between 0 and 1000 or similar\n* For each reversed version, recompute the correlation between the feature and its lagged version.\n* Identify the random state(s) that restore the highest correlation (or most similar to the corresponding correlation on the training dataset), suggesting the most plausible original ordering.\n\n\nI tried the above for feature X1 when applied the function @gromml use in the linked notebook, and it does indeed seem to work.\n\nThat said, I guess it is not allowed since it alters what to optimize for etc.",
    "3243813": "I got Corr of 0.48 by using your unshuffling and building a target so I think you are correct/on the right lines.",
    "3243826": "![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7192196%2F8baef67548b89775983413f8e61f990f%2Ftime_features.png?generation=1751900256075827&alt=media)\n\nAt a fast check I think u are right\n\n01/03/2024\tFriday\t2,125\n29/03/2024\tFriday\t1,8125\n26/04/2024\tFriday\t2,1875\n31/05/2024\tFriday\t1,75\n28/06/2024\tFriday\t1,75\n26/07/2024\tFriday\t2,1875\n30/08/2024\tFriday\t1,75\n27/09/2024\tFriday\t1,75\n25/10/2024\tFriday\t2,1875\n29/11/2024\tFriday\t1,75\n27/12/2024\tFriday\t2,1875\n31/01/2025\tFriday\t1,75\n28/02/2025\tFriday\t1,75\n09/03/2025\tFriday\t\n\t\t\n29 march Good Friday\t\n\nThe first 2 periods are deterministic...",
    "3243884": "Interesting, this really throws into doubt some of the breakaway scores.",
    "3244263": "Are the constructed labels derived from external data",
    "3244426": "It's cool, a kind of continuation of https://www.kaggle.com/competitions/drw-crypto-market-prediction/discussion/584485"
  },
  "source": "meta"
}