{
  "id": 375148,
  "title": "can we use session id find the sessions of the same user in the training session?",
  "url": "/competitions/otto-recommender-system/discussion/375148",
  "author_name": "",
  "post_date": "2022-12-30T14:49:12.815641100Z",
  "votes": 2,
  "comment_count": 5,
  "views": 0,
  "content": "<p>when I try to find the sessions of the same user in the training_session for sessions in testing_session using below code:</p>\n<pre><code>(train_df[].unique()).intersection((test_df[].unique()))\n</code></pre>\n<p>I get </p>\n<pre><code>()\n</code></pre>\n<p>which means I failed.</p>",
  "messages": [
    {
      "id": "2080844",
      "postDate": "12/30/2022 14:49:12",
      "content": "<p>when I try to find the sessions of the same user in the training_session for sessions in testing_session using below code:</p>\n<pre><code>(train_df[].unique()).intersection((test_df[].unique()))\n</code></pre>\n<p>I get </p>\n<pre><code>()\n</code></pre>\n<p>which means I failed.</p>",
      "rawMarkdown": "when I try to find the sessions of the same user in the training_session for sessions in testing_session using below code:\n```python\nset(train_df['session'].unique()).intersection(set(test_df['session'].unique()))\n```\nI get \n```bash\nset()\n```\nwhich means I failed.",
      "votes": null
    },
    {
      "id": "2080855",
      "postDate": "12/30/2022 15:08:35",
      "content": "<p>Hi, <a href=\"https://www.kaggle.com/biubiug\" target=\"_blank\">@biubiug</a>. As, I understood, the dataset is built in such a way that we don't know if there are the same users from the train and test sets. There may be, but after the training period, sessions in the test set were assigned different IDs even if 'session' was the same user. Nevertheless, there is a way to try to find <em>similar</em> users and use their similarities as features: use matrix factorization and collaborative filtering.</p>",
      "rawMarkdown": "Hi, @biubiug. As, I understood, the dataset is built in such a way that we don't know if there are the same users from the train and test sets. There may be, but after the training period, sessions in the test set were assigned different IDs even if 'session' was the same user. Nevertheless, there is a way to try to find *similar* users and use their similarities as features: use matrix factorization and collaborative filtering.",
      "votes": null
    },
    {
      "id": "2081272",
      "postDate": "12/31/2022 02:37:19",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/biubiug\" target=\"_blank\">@biubiug</a> </p>\n<p>Since we want to evaluate a model's performance in the future, as would be the case when we deploy such a system in an actual webshop, we choose a time-based validation split. Our train set consists of observations from 4 weeks, while the test set contains user sessions from the following week. Furthermore, we trimmed train sessions overlapping with the test period, as depicted in the following diagram, to prevent information leakage from the future:<br>\n<img src=\"https://github.com/otto-de/recsys-dataset/raw/main/.readme/train_test_split.png\" alt=\"\"><br>\n<a href=\"https://github.com/otto-de/recsys-dataset#traintest-split\" target=\"_blank\">Source</a><br>\nSo you did not fail but got the correct result. </p>",
      "rawMarkdown": "Hi @biubiug \n\nSince we want to evaluate a model's performance in the future, as would be the case when we deploy such a system in an actual webshop, we choose a time-based validation split. Our train set consists of observations from 4 weeks, while the test set contains user sessions from the following week. Furthermore, we trimmed train sessions overlapping with the test period, as depicted in the following diagram, to prevent information leakage from the future:\n![](https://github.com/otto-de/recsys-dataset/raw/main/.readme/train_test_split.png)\n[Source](https://github.com/otto-de/recsys-dataset#traintest-split)\nSo you did not fail but got the correct result.",
      "votes": null
    },
    {
      "id": "2081337",
      "postDate": "12/31/2022 04:23:42",
      "content": "<p>According to the document prepared by the host <a href=\"https://github.com/otto-de/recsys-dataset#faq\" target=\"_blank\">here</a>, there are NO identical users in the training and test set. We could learn more about the dataset therein.</p>",
      "rawMarkdown": "According to the document prepared by the host [here](https://github.com/otto-de/recsys-dataset#faq), there are NO identical users in the training and test set. We could learn more about the dataset therein.",
      "votes": null
    },
    {
      "id": "2081461",
      "postDate": "12/31/2022 07:51:40",
      "content": "<p>your reply is really helpful for me, thx!</p>",
      "rawMarkdown": "your reply is really helpful for me, thx!",
      "votes": null
    },
    {
      "id": "2081464",
      "postDate": "12/31/2022 07:55:40",
      "content": "<p>thanks, btw, are they belong to the same user if they are in the same row, in the above picture you posted?<br>\nin the competition setting, are user behaviors we can use ,  the behaviors in the test session? </p>",
      "rawMarkdown": "thanks, btw, are they belong to the same user if they are in the same row, in the above picture you posted?\nin the competition setting, are user behaviors we can use ,  the behaviors in the test session?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2080855,
      "author_name": "jamnik99",
      "author_url": "",
      "post_date": "12/30/2022 15:08:35",
      "content": "<p>Hi, <a href=\"https://www.kaggle.com/biubiug\" target=\"_blank\">@biubiug</a>. As, I understood, the dataset is built in such a way that we don't know if there are the same users from the train and test sets. There may be, but after the training period, sessions in the test set were assigned different IDs even if 'session' was the same user. Nevertheless, there is a way to try to find <em>similar</em> users and use their similarities as features: use matrix factorization and collaborative filtering.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2081461,
          "author_name": "biubiug",
          "author_url": "",
          "post_date": "12/31/2022 07:51:40",
          "content": "<p>your reply is really helpful for me, thx!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2081272,
      "author_name": "andreaswand",
      "author_url": "",
      "post_date": "12/31/2022 02:37:19",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/biubiug\" target=\"_blank\">@biubiug</a> </p>\n<p>Since we want to evaluate a model's performance in the future, as would be the case when we deploy such a system in an actual webshop, we choose a time-based validation split. Our train set consists of observations from 4 weeks, while the test set contains user sessions from the following week. Furthermore, we trimmed train sessions overlapping with the test period, as depicted in the following diagram, to prevent information leakage from the future:<br>\n<img src=\"https://github.com/otto-de/recsys-dataset/raw/main/.readme/train_test_split.png\" alt=\"\"><br>\n<a href=\"https://github.com/otto-de/recsys-dataset#traintest-split\" target=\"_blank\">Source</a><br>\nSo you did not fail but got the correct result. </p>",
      "votes": null,
      "replies": [
        {
          "id": 2081464,
          "author_name": "biubiug",
          "author_url": "",
          "post_date": "12/31/2022 07:55:40",
          "content": "<p>thanks, btw, are they belong to the same user if they are in the same row, in the above picture you posted?<br>\nin the competition setting, are user behaviors we can use ,  the behaviors in the test session? </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2081337,
      "author_name": "radream",
      "author_url": "",
      "post_date": "12/31/2022 04:23:42",
      "content": "<p>According to the document prepared by the host <a href=\"https://github.com/otto-de/recsys-dataset#faq\" target=\"_blank\">here</a>, there are NO identical users in the training and test set. We could learn more about the dataset therein.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2080844": "when I try to find the sessions of the same user in the training_session for sessions in testing_session using below code:\n```python\nset(train_df['session'].unique()).intersection(set(test_df['session'].unique()))\n```\nI get \n```bash\nset()\n```\nwhich means I failed.",
    "2080855": "Hi, @biubiug. As, I understood, the dataset is built in such a way that we don't know if there are the same users from the train and test sets. There may be, but after the training period, sessions in the test set were assigned different IDs even if 'session' was the same user. Nevertheless, there is a way to try to find *similar* users and use their similarities as features: use matrix factorization and collaborative filtering.",
    "2081272": "Hi @biubiug \n\nSince we want to evaluate a model's performance in the future, as would be the case when we deploy such a system in an actual webshop, we choose a time-based validation split. Our train set consists of observations from 4 weeks, while the test set contains user sessions from the following week. Furthermore, we trimmed train sessions overlapping with the test period, as depicted in the following diagram, to prevent information leakage from the future:\n![](https://github.com/otto-de/recsys-dataset/raw/main/.readme/train_test_split.png)\n[Source](https://github.com/otto-de/recsys-dataset#traintest-split)\nSo you did not fail but got the correct result.",
    "2081337": "According to the document prepared by the host [here](https://github.com/otto-de/recsys-dataset#faq), there are NO identical users in the training and test set. We could learn more about the dataset therein.",
    "2081461": "your reply is really helpful for me, thx!",
    "2081464": "thanks, btw, are they belong to the same user if they are in the same row, in the above picture you posted?\nin the competition setting, are user behaviors we can use ,  the behaviors in the test session?"
  },
  "source": "meta"
}