{
  "id": 366169,
  "title": "How events in test sessions are split?",
  "url": "/competitions/otto-recommender-system/discussion/366169",
  "author_name": "",
  "post_date": "2022-11-15T06:17:06.323102800Z",
  "votes": 5,
  "comment_count": 3,
  "views": 0,
  "content": "<p><a href=\"https://www.kaggle.com/pnormann\" target=\"_blank\">@pnormann</a></p>\n<p>What is the split method of test sessions to calculate public &amp; private LBs?</p>\n<p>Possibilities:</p>\n<ul>\n<li>number of events (if a session has N events in total, provided evens are first (1-p) * N events, and hidden evens are last p * N events) </li>\n<li>term: (if a session has n days long, provided events are events in first (1-p) * n days, and hidden evens are the events in the last p * N days)</li>\n<li>etc.</li>\n</ul>\n<p><a href=\"https://ibb.co/tbpfnTk\"><img src=\"https://i.ibb.co/0fyN1R8/Screen-Shot-2022-11-15-at-15-09-45.png\" alt=\"Screen-Shot-2022-11-15-at-15-09-45\"></a></p>",
  "messages": [
    {
      "id": "2030017",
      "postDate": "11/15/2022 06:17:06",
      "content": "<p><a href=\"https://www.kaggle.com/pnormann\" target=\"_blank\">@pnormann</a></p>\n<p>What is the split method of test sessions to calculate public &amp; private LBs?</p>\n<p>Possibilities:</p>\n<ul>\n<li>number of events (if a session has N events in total, provided evens are first (1-p) * N events, and hidden evens are last p * N events) </li>\n<li>term: (if a session has n days long, provided events are events in first (1-p) * n days, and hidden evens are the events in the last p * N days)</li>\n<li>etc.</li>\n</ul>\n<p><a href=\"https://ibb.co/tbpfnTk\"><img src=\"https://i.ibb.co/0fyN1R8/Screen-Shot-2022-11-15-at-15-09-45.png\" alt=\"Screen-Shot-2022-11-15-at-15-09-45\"></a></p>",
      "rawMarkdown": "pnormann\n\nWhat is the split method of test sessions to calculate public & private LBs?\n\nPossibilities:\n* number of events (if a session has N events in total, provided evens are first (1-p) * N events, and hidden evens are last p * N events) \n* term: (if a session has n days long, provided events are events in first (1-p) * n days, and hidden evens are the events in the last p * N days)\n* etc.\n\n<a href=\"https://ibb.co/tbpfnTk\"><img src=\"https://i.ibb.co/0fyN1R8/Screen-Shot-2022-11-15-at-15-09-45.png\" alt=\"Screen-Shot-2022-11-15-at-15-09-45\" border=\"0\"></a>",
      "votes": null
    },
    {
      "id": "2030126",
      "postDate": "11/15/2022 08:01:59",
      "content": "<p>We can let Philipp reply, but i think the code to split public private is <a href=\"https://github.com/otto-de/recsys-dataset/blob/f5bf55d4bf9c1e9be367563289a2beb04a9b9b58/src/testset.py#L22\" target=\"_blank\">here</a>. It looks like a random split of events</p>\n<pre><code>test_events = ground_truth(deepcopy(events))\nif not split_idx:\n    split_idx = random.randint(1, len(test_events))\ntest_events = test_events[:split_idx]\n</code></pre>",
      "rawMarkdown": "We can let Philipp reply, but i think the code to split public private is [here][1]. It looks like a random split of events\n\n    test_events = ground_truth(deepcopy(events))\n    if not split_idx:\n        split_idx = random.randint(1, len(test_events))\n    test_events = test_events[:split_idx]\n\n[1]: https://github.com/otto-de/recsys-dataset/blob/f5bf55d4bf9c1e9be367563289a2beb04a9b9b58/src/testset.py#L22",
      "votes": null
    },
    {
      "id": "2030127",
      "postDate": "11/15/2022 08:02:35",
      "content": "<p>Hi,<br>\nyou should refer to the github <a href=\"https://github.com/otto-de/recsys-dataset/blob/f5bf55d4bf9c1e9be367563289a2beb04a9b9b58/src/testset.py#L22\" target=\"_blank\">repo</a> of the competition to answer this question.</p>\n<p>In particular the link above in this comment takes you to the <strong>split_events</strong> function that shows you the answer. The split point is decided over the session lenght choosing a random split point with <strong>random.randint(1, len(test_events))</strong> , where test_event contains a single session as a list of user actions. </p>",
      "rawMarkdown": "Hi,\nyou should refer to the github [repo](https://github.com/otto-de/recsys-dataset/blob/f5bf55d4bf9c1e9be367563289a2beb04a9b9b58/src/testset.py#L22) of the competition to answer this question.\n\nIn particular the link above in this comment takes you to the **split_events** function that shows you the answer. The split point is decided over the session lenght choosing a random split point with **random.randint(1, len(test_events))** , where test_event contains a single session as a list of user actions.",
      "votes": null
    },
    {
      "id": "2030156",
      "postDate": "11/15/2022 08:29:53",
      "content": "<p><a href=\"https://www.kaggle.com/pietromaldini1\" target=\"_blank\">@pietromaldini1</a> <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a> Thanks for the reply.</p>",
      "rawMarkdown": "pietromaldini1 @cdeotte Thanks for the reply.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2030126,
      "author_name": "cdeotte",
      "author_url": "",
      "post_date": "11/15/2022 08:01:59",
      "content": "<p>We can let Philipp reply, but i think the code to split public private is <a href=\"https://github.com/otto-de/recsys-dataset/blob/f5bf55d4bf9c1e9be367563289a2beb04a9b9b58/src/testset.py#L22\" target=\"_blank\">here</a>. It looks like a random split of events</p>\n<pre><code>test_events = ground_truth(deepcopy(events))\nif not split_idx:\n    split_idx = random.randint(1, len(test_events))\ntest_events = test_events[:split_idx]\n</code></pre>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2030127,
      "author_name": "pietromaldini1",
      "author_url": "",
      "post_date": "11/15/2022 08:02:35",
      "content": "<p>Hi,<br>\nyou should refer to the github <a href=\"https://github.com/otto-de/recsys-dataset/blob/f5bf55d4bf9c1e9be367563289a2beb04a9b9b58/src/testset.py#L22\" target=\"_blank\">repo</a> of the competition to answer this question.</p>\n<p>In particular the link above in this comment takes you to the <strong>split_events</strong> function that shows you the answer. The split point is decided over the session lenght choosing a random split point with <strong>random.randint(1, len(test_events))</strong> , where test_event contains a single session as a list of user actions. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2030156,
      "author_name": "tatamikenn",
      "author_url": "",
      "post_date": "11/15/2022 08:29:53",
      "content": "<p><a href=\"https://www.kaggle.com/pietromaldini1\" target=\"_blank\">@pietromaldini1</a> <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a> Thanks for the reply.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2030017": "pnormann\n\nWhat is the split method of test sessions to calculate public & private LBs?\n\nPossibilities:\n* number of events (if a session has N events in total, provided evens are first (1-p) * N events, and hidden evens are last p * N events) \n* term: (if a session has n days long, provided events are events in first (1-p) * n days, and hidden evens are the events in the last p * N days)\n* etc.\n\n<a href=\"https://ibb.co/tbpfnTk\"><img src=\"https://i.ibb.co/0fyN1R8/Screen-Shot-2022-11-15-at-15-09-45.png\" alt=\"Screen-Shot-2022-11-15-at-15-09-45\" border=\"0\"></a>",
    "2030126": "We can let Philipp reply, but i think the code to split public private is [here][1]. It looks like a random split of events\n\n    test_events = ground_truth(deepcopy(events))\n    if not split_idx:\n        split_idx = random.randint(1, len(test_events))\n    test_events = test_events[:split_idx]\n\n[1]: https://github.com/otto-de/recsys-dataset/blob/f5bf55d4bf9c1e9be367563289a2beb04a9b9b58/src/testset.py#L22",
    "2030127": "Hi,\nyou should refer to the github [repo](https://github.com/otto-de/recsys-dataset/blob/f5bf55d4bf9c1e9be367563289a2beb04a9b9b58/src/testset.py#L22) of the competition to answer this question.\n\nIn particular the link above in this comment takes you to the **split_events** function that shows you the answer. The split point is decided over the session lenght choosing a random split point with **random.randint(1, len(test_events))** , where test_event contains a single session as a list of user actions.",
    "2030156": "pietromaldini1 @cdeotte Thanks for the reply."
  },
  "source": "meta"
}