{
  "id": 371678,
  "title": "The Story of User 13479136 and User 13710374",
  "url": "/competitions/otto-recommender-system/discussion/371678",
  "author_name": "",
  "post_date": "2022-12-11T16:51:02.869361100Z",
  "votes": 79,
  "comment_count": 15,
  "views": 0,
  "content": "<h1>Revealing Item Identity with RAPIDS TSNE</h1>\n<p>In Kaggle's Otto competition, there are 12 million unique users and 2 million unique items! Both have anonymized ids, so we don't know what the different items are and we don't know who the users are.</p>\n<p>Using matrix factorization, we can produce meaningful embeddings for items. We can project the embeddings into 2D x-y-plane with RAPIDS TSNE. Then each item is one dot. Below we plot all 2 million items as blue dots.</p>\n<p>When dots are close to each other (in the x-y-plane) then they are similar items (like both are clothing) and when dots are far from each other they are different items like (one is clothing and the other is electronics).</p>\n<p>We observe clusters of blue dots in the plot below. These are the different categories of items like clothing and electronics.</p>\n<h1>The Story of User 13479136</h1>\n<p>Now that we have deciphered the category of each item, we understand how users shop. We plot each item that a user interacts with in the 2D x-y-plane. We will plot the dots in chronological order and connect the dots. We now understand user 13479136's behavior!</p>\n<p>On Wednesday Aug 31st, we see that user 13479136 first visits an item in the dark blue oval labeled \"A\" below. They probably saw an ad somewhere on the internet and clicked it. The user likes the Otto website but quickly leaves the category of this initial item and jumps to items in category oval labeled \"B\" below (where we see number 2). The user likes what they see in \"B\", remembers it, and jumps to oval \"C\" (where we see number 3). For numbers 3 thru 10, the user shops in oval \"C\". Then they jump to oval \"D\" for numbers 11 thru 21. So on Wednesday morning at 9am, the user viewed 19 items. Then at 4pm then returned to view 2 more items. All these items were in ovals \"A\", \"B\", \"C\", \"D\" where the majority of the browsing was in ovals \"C\", \"D\".</p>\n<p>On Thursday Sept 1st, user 13479136 returns to Otto website and begins in oval \"C\" and \"D\" for a few clicks then leaves the website. At 3pm, they return and begin to explore oval \"B\" that they remembered from yesterday. They view numbers 27 thru 33. Then leave. At 8pm, they return to view more items back in oval \"C\".</p>\n<p>On Friday Sept 2nd at 9am, they return once more to Otto website and this time explore new items in category oval \"E\". Something attracts their attention because they jump to a different category oval \"F\" to view one item, then put that one item in their cart, and then quickly return back to oval \"E\". What happened here? Was the item from oval \"F\" related to their previous browsing, or did they see something that they remembered they needed to buy, jumped to it, and added it to their cart? Interesting.</p>\n<p><img src=\"https://raw.githubusercontent.com/cdeotte/Kaggle_Images/main/Dec-2022/pic1.png\" alt=\"\"></p>\n<h1>The Story of User 13710374</h1>\n<p>On Wednesday Aug 31st, after user 13479136 logs out, we see that user 13710374 logs in to Otto website. They first browse items in category oval \"G\". This is a new category that previous user 13479136 did not explore. User 13710374 likes what they see and puts a few items in their cart. That Wednesday, they leave Otto website without buying anything.</p>\n<p>On Saturday Sep 3rd, user 13710374 returns and visits oval \"C\". This is the same oval \"C\" that user 13479136 visited on 9am Wednesday and 8pm Thursday. User 13710374 likes what they see and adds some items to their cart.</p>\n<p><img src=\"https://raw.githubusercontent.com/cdeotte/Kaggle_Images/main/Dec-2022/pic4.png\" alt=\"\">   </p>\n<h1>What Will They Click, Cart, Order Next?</h1>\n<p>The above 2 users are 2 test users. We see the first half of their activity on the week of Aug 29th 2022, what will they click, cart, and order and the second half? Will user 13710374 order the items in their cart? Will user 13479136 return to their previously viewed ovals of \"C\" and \"D\" and order something from there?</p>\n<h1>Starter Notebook</h1>\n<p>I published a starter notebook <a href=\"https://www.kaggle.com/code/cdeotte/user-eda-with-rapids-tsne-and-matrix-factorization\" target=\"_blank\">here</a> that allows us to view all users and explore their behavior. Understanding how users traverse Otto website will help us generate better candidates and build better features for our GBT ranker models!</p>\n<h1>The Story of User 13096729</h1>\n<p>Here is one more user to discuss. User 13096729 has visited Otto website on 7 separate occasions. They visited on Mon Aug29th at 8pm. Then Tue Aug 30rd at 4am, 4pm, 8pm. Then Wed Aug31st at 6pm. Then Thr Sep1st at 4pm and 8pm. Each time they only browse items in category oval \"H\". They have not added anything to their cart nor made any orders. I predict they will visit Otto later in the week and click more items in category \"H\".</p>\n<p><img src=\"https://raw.githubusercontent.com/cdeotte/Kaggle_Images/main/Dec-2022/pic6.png\" alt=\"\">   </p>",
  "messages": [
    {
      "id": "2061992",
      "postDate": "12/11/2022 16:51:02",
      "content": "<h1>Revealing Item Identity with RAPIDS TSNE</h1>\n<p>In Kaggle's Otto competition, there are 12 million unique users and 2 million unique items! Both have anonymized ids, so we don't know what the different items are and we don't know who the users are.</p>\n<p>Using matrix factorization, we can produce meaningful embeddings for items. We can project the embeddings into 2D x-y-plane with RAPIDS TSNE. Then each item is one dot. Below we plot all 2 million items as blue dots.</p>\n<p>When dots are close to each other (in the x-y-plane) then they are similar items (like both are clothing) and when dots are far from each other they are different items like (one is clothing and the other is electronics).</p>\n<p>We observe clusters of blue dots in the plot below. These are the different categories of items like clothing and electronics.</p>\n<h1>The Story of User 13479136</h1>\n<p>Now that we have deciphered the category of each item, we understand how users shop. We plot each item that a user interacts with in the 2D x-y-plane. We will plot the dots in chronological order and connect the dots. We now understand user 13479136's behavior!</p>\n<p>On Wednesday Aug 31st, we see that user 13479136 first visits an item in the dark blue oval labeled \"A\" below. They probably saw an ad somewhere on the internet and clicked it. The user likes the Otto website but quickly leaves the category of this initial item and jumps to items in category oval labeled \"B\" below (where we see number 2). The user likes what they see in \"B\", remembers it, and jumps to oval \"C\" (where we see number 3). For numbers 3 thru 10, the user shops in oval \"C\". Then they jump to oval \"D\" for numbers 11 thru 21. So on Wednesday morning at 9am, the user viewed 19 items. Then at 4pm then returned to view 2 more items. All these items were in ovals \"A\", \"B\", \"C\", \"D\" where the majority of the browsing was in ovals \"C\", \"D\".</p>\n<p>On Thursday Sept 1st, user 13479136 returns to Otto website and begins in oval \"C\" and \"D\" for a few clicks then leaves the website. At 3pm, they return and begin to explore oval \"B\" that they remembered from yesterday. They view numbers 27 thru 33. Then leave. At 8pm, they return to view more items back in oval \"C\".</p>\n<p>On Friday Sept 2nd at 9am, they return once more to Otto website and this time explore new items in category oval \"E\". Something attracts their attention because they jump to a different category oval \"F\" to view one item, then put that one item in their cart, and then quickly return back to oval \"E\". What happened here? Was the item from oval \"F\" related to their previous browsing, or did they see something that they remembered they needed to buy, jumped to it, and added it to their cart? Interesting.</p>\n<p><img src=\"https://raw.githubusercontent.com/cdeotte/Kaggle_Images/main/Dec-2022/pic1.png\" alt=\"\"></p>\n<h1>The Story of User 13710374</h1>\n<p>On Wednesday Aug 31st, after user 13479136 logs out, we see that user 13710374 logs in to Otto website. They first browse items in category oval \"G\". This is a new category that previous user 13479136 did not explore. User 13710374 likes what they see and puts a few items in their cart. That Wednesday, they leave Otto website without buying anything.</p>\n<p>On Saturday Sep 3rd, user 13710374 returns and visits oval \"C\". This is the same oval \"C\" that user 13479136 visited on 9am Wednesday and 8pm Thursday. User 13710374 likes what they see and adds some items to their cart.</p>\n<p><img src=\"https://raw.githubusercontent.com/cdeotte/Kaggle_Images/main/Dec-2022/pic4.png\" alt=\"\">   </p>\n<h1>What Will They Click, Cart, Order Next?</h1>\n<p>The above 2 users are 2 test users. We see the first half of their activity on the week of Aug 29th 2022, what will they click, cart, and order and the second half? Will user 13710374 order the items in their cart? Will user 13479136 return to their previously viewed ovals of \"C\" and \"D\" and order something from there?</p>\n<h1>Starter Notebook</h1>\n<p>I published a starter notebook <a href=\"https://www.kaggle.com/code/cdeotte/user-eda-with-rapids-tsne-and-matrix-factorization\" target=\"_blank\">here</a> that allows us to view all users and explore their behavior. Understanding how users traverse Otto website will help us generate better candidates and build better features for our GBT ranker models!</p>\n<h1>The Story of User 13096729</h1>\n<p>Here is one more user to discuss. User 13096729 has visited Otto website on 7 separate occasions. They visited on Mon Aug29th at 8pm. Then Tue Aug 30rd at 4am, 4pm, 8pm. Then Wed Aug31st at 6pm. Then Thr Sep1st at 4pm and 8pm. Each time they only browse items in category oval \"H\". They have not added anything to their cart nor made any orders. I predict they will visit Otto later in the week and click more items in category \"H\".</p>\n<p><img src=\"https://raw.githubusercontent.com/cdeotte/Kaggle_Images/main/Dec-2022/pic6.png\" alt=\"\">   </p>",
      "rawMarkdown": "# Revealing Item Identity with RAPIDS TSNE\nIn Kaggle's Otto competition, there are 12 million unique users and 2 million unique items! Both have anonymized ids, so we don't know what the different items are and we don't know who the users are.\n\nUsing matrix factorization, we can produce meaningful embeddings for items. We can project the embeddings into 2D x-y-plane with RAPIDS TSNE. Then each item is one dot. Below we plot all 2 million items as blue dots.\n\nWhen dots are close to each other (in the x-y-plane) then they are similar items (like both are clothing) and when dots are far from each other they are different items like (one is clothing and the other is electronics).\n\nWe observe clusters of blue dots in the plot below. These are the different categories of items like clothing and electronics.\n\n# The Story of User 13479136\nNow that we have deciphered the category of each item, we understand how users shop. We plot each item that a user interacts with in the 2D x-y-plane. We will plot the dots in chronological order and connect the dots. We now understand user 13479136's behavior!\n\nOn Wednesday Aug 31st, we see that user 13479136 first visits an item in the dark blue oval labeled \"A\" below. They probably saw an ad somewhere on the internet and clicked it. The user likes the Otto website but quickly leaves the category of this initial item and jumps to items in category oval labeled \"B\" below (where we see number 2). The user likes what they see in \"B\", remembers it, and jumps to oval \"C\" (where we see number 3). For numbers 3 thru 10, the user shops in oval \"C\". Then they jump to oval \"D\" for numbers 11 thru 21. So on Wednesday morning at 9am, the user viewed 19 items. Then at 4pm then returned to view 2 more items. All these items were in ovals \"A\", \"B\", \"C\", \"D\" where the majority of the browsing was in ovals \"C\", \"D\".\n\nOn Thursday Sept 1st, user 13479136 returns to Otto website and begins in oval \"C\" and \"D\" for a few clicks then leaves the website. At 3pm, they return and begin to explore oval \"B\" that they remembered from yesterday. They view numbers 27 thru 33. Then leave. At 8pm, they return to view more items back in oval \"C\".\n\nOn Friday Sept 2nd at 9am, they return once more to Otto website and this time explore new items in category oval \"E\". Something attracts their attention because they jump to a different category oval \"F\" to view one item, then put that one item in their cart, and then quickly return back to oval \"E\". What happened here? Was the item from oval \"F\" related to their previous browsing, or did they see something that they remembered they needed to buy, jumped to it, and added it to their cart? Interesting.\n\n![](https://raw.githubusercontent.com/cdeotte/Kaggle_Images/main/Dec-2022/pic1.png)\n\n# The Story of User 13710374\nOn Wednesday Aug 31st, after user 13479136 logs out, we see that user 13710374 logs in to Otto website. They first browse items in category oval \"G\". This is a new category that previous user 13479136 did not explore. User 13710374 likes what they see and puts a few items in their cart. That Wednesday, they leave Otto website without buying anything.\n\nOn Saturday Sep 3rd, user 13710374 returns and visits oval \"C\". This is the same oval \"C\" that user 13479136 visited on 9am Wednesday and 8pm Thursday. User 13710374 likes what they see and adds some items to their cart.\n\n![](https://raw.githubusercontent.com/cdeotte/Kaggle_Images/main/Dec-2022/pic4.png)   \n\n# What Will They Click, Cart, Order Next?\nThe above 2 users are 2 test users. We see the first half of their activity on the week of Aug 29th 2022, what will they click, cart, and order and the second half? Will user 13710374 order the items in their cart? Will user 13479136 return to their previously viewed ovals of \"C\" and \"D\" and order something from there?\n\n# Starter Notebook\nI published a starter notebook [here][1] that allows us to view all users and explore their behavior. Understanding how users traverse Otto website will help us generate better candidates and build better features for our GBT ranker models!\n\n# The Story of User 13096729\nHere is one more user to discuss. User 13096729 has visited Otto website on 7 separate occasions. They visited on Mon Aug29th at 8pm. Then Tue Aug 30rd at 4am, 4pm, 8pm. Then Wed Aug31st at 6pm. Then Thr Sep1st at 4pm and 8pm. Each time they only browse items in category oval \"H\". They have not added anything to their cart nor made any orders. I predict they will visit Otto later in the week and click more items in category \"H\".\n\n![](https://raw.githubusercontent.com/cdeotte/Kaggle_Images/main/Dec-2022/pic6.png)   \n\n[1]: https://www.kaggle.com/code/cdeotte/user-eda-with-rapids-tsne-and-matrix-factorization",
      "votes": null
    },
    {
      "id": "2062091",
      "postDate": "12/11/2022 18:02:37",
      "content": "<p>Hi, <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a>! Thanks for the very insightful charts! After several looks at the users' paths, I started thinking whether RecSys, which we are trying to teach/develop, will be predicting the actual AIDs that users want to buy or the AIDs that were recommended to users by the current OTTO's RecSys 😅</p>",
      "rawMarkdown": "Hi, @cdeotte! Thanks for the very insightful charts! After several looks at the users' paths, I started thinking whether RecSys, which we are trying to teach/develop, will be predicting the actual AIDs that users want to buy or the AIDs that were recommended to users by the current OTTO's RecSys 😅",
      "votes": null
    },
    {
      "id": "2062100",
      "postDate": "12/11/2022 18:16:14",
      "content": "<p>Great point Nick. This is true regarding most online prediction tasks. What a user does next depends on what the website shows the user. Our job is basically to predict both. Our \"candidate rerank\" need candidates and rerank logic/model. The candidates are us predicting what Otto will show users and the rerank logic/model is us predicting what the user will select from the options presented.</p>\n<p>(Roughly speaking, matrix factorization and/or co-visitation matrices learn Otto's recsys. And our GBT ranker learns the user's selections)</p>",
      "rawMarkdown": "Great point Nick. This is true regarding most online prediction tasks. What a user does next depends on what the website shows the user. Our job is basically to predict both. Our \"candidate rerank\" need candidates and rerank logic/model. The candidates are us predicting what Otto will show users and the rerank logic/model is us predicting what the user will select from the options presented.\n\n(Roughly speaking, matrix factorization and/or co-visitation matrices learn Otto's recsys. And our GBT ranker learns the user's selections)",
      "votes": null
    },
    {
      "id": "2062700",
      "postDate": "12/12/2022 10:07:02",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/jamnik99\" target=\"_blank\">@jamnik99</a>, although this idea may seem plausible, one should consider that in our case, only about 20% of the product page views are generated by our recommendations, and the majority of the users reach product pages via search results and product lists.</p>",
      "rawMarkdown": "Hi @jamnik99, although this idea may seem plausible, one should consider that in our case, only about 20% of the product page views are generated by our recommendations, and the majority of the users reach product pages via search results and product lists.",
      "votes": null
    },
    {
      "id": "2062718",
      "postDate": "12/12/2022 10:22:09",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a>, first of all: THIS IS BEAUTIFUL 😍 We want to thank you for your numerous insightful contributions to this competition and your willingness to share your vast knowledge with the community. We are excited about your visualization and are thinking of using a similar approach to improve the explainability of our models to our stakeholders. Keep up the good work! 💪</p>",
      "rawMarkdown": "Hi @cdeotte, first of all: THIS IS BEAUTIFUL 😍 We want to thank you for your numerous insightful contributions to this competition and your willingness to share your vast knowledge with the community. We are excited about your visualization and are thinking of using a similar approach to improve the explainability of our models to our stakeholders. Keep up the good work! 💪",
      "votes": null
    },
    {
      "id": "2062857",
      "postDate": "12/12/2022 13:42:13",
      "content": "<p>unbeliavable</p>",
      "rawMarkdown": "unbeliavable",
      "votes": null
    },
    {
      "id": "2062914",
      "postDate": "12/12/2022 14:15:36",
      "content": "<p>Mind-boggling visualization! This really shows the vastness and complexity of the task we are given here. I was for one minute wondering if you were pulling my leg, and actually posted a picture of cluster of galaxies taken by the James Webb telescope. Anyways, the analogy is not far off. This just goes to show that predicting in this case is maybe more akin to telling a story. Its not just similar products in the category you are in, its also products related in some way in other categories. Lets say you just bought a new apartment, and now you are browsing the OTTO website for new items you need, starting with the essentials. Given enough training, one could imagine a model could learn these different patterns and behaviors over time. Much like OpenAI's LLM's are learning how to write a story from analyzing vast amounts of data. Exiting none the less, and I'm sure some bright minds will revolutionize this space given time and the emerging tools AI provides.</p>",
      "rawMarkdown": "Mind-boggling visualization! This really shows the vastness and complexity of the task we are given here. I was for one minute wondering if you were pulling my leg, and actually posted a picture of cluster of galaxies taken by the James Webb telescope. Anyways, the analogy is not far off. This just goes to show that predicting in this case is maybe more akin to telling a story. Its not just similar products in the category you are in, its also products related in some way in other categories. Lets say you just bought a new apartment, and now you are browsing the OTTO website for new items you need, starting with the essentials. Given enough training, one could imagine a model could learn these different patterns and behaviors over time. Much like OpenAI's LLM's are learning how to write a story from analyzing vast amounts of data. Exiting none the less, and I'm sure some bright minds will revolutionize this space given time and the emerging tools AI provides.",
      "votes": null
    },
    {
      "id": "2063025",
      "postDate": "12/12/2022 15:25:06",
      "content": "<p>If it's a set of galaxies, it must be the aztec warrior constelation <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F820904%2F05cc89325dc7dfa05d249d8171bd62b4%2Faztec.jpeg?generation=1670858690856550&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "If it's a set of galaxies, it must be the aztec warrior constelation ![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F820904%2F05cc89325dc7dfa05d249d8171bd62b4%2Faztec.jpeg?generation=1670858690856550&alt=media)",
      "votes": null
    },
    {
      "id": "2063136",
      "postDate": "12/12/2022 16:51:56",
      "content": "<p>Yes, must be. How strange the universe is 😄</p>",
      "rawMarkdown": "Yes, must be. How strange the universe is 😄",
      "votes": null
    },
    {
      "id": "2063687",
      "postDate": "12/13/2022 07:49:52",
      "content": "<p>This is fascinating!</p>",
      "rawMarkdown": "This is fascinating!",
      "votes": null
    },
    {
      "id": "2063962",
      "postDate": "12/13/2022 12:42:56",
      "content": "<p>Beautiful stuff, thanks <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a>!</p>",
      "rawMarkdown": "Beautiful stuff, thanks @cdeotte!",
      "votes": null
    },
    {
      "id": "2068171",
      "postDate": "12/17/2022 15:19:27",
      "content": "<p>Hi Chris, awesome post. One question, since a pivoted user-item table would be immensely large to be applied TSNE you first computed embeddings as a dimensionality reduction technique so then you could effectively apply TSNE on a lower dimensional space? <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a> </p>",
      "rawMarkdown": "Hi Chris, awesome post. One question, since a pivoted user-item table would be immensely large to be applied TSNE you first computed embeddings as a dimensionality reduction technique so then you could effectively apply TSNE on a lower dimensional space? @cdeotte",
      "votes": null
    },
    {
      "id": "2068190",
      "postDate": "12/17/2022 15:38:48",
      "content": "<p>We create embeddings of dimension 32 for each of the 1.8 million unique items. We do this by training a neural network which takes two item ids, then converts them to their embeddings (from embedding table which is being learned and changed during training). Then the two embeddings are dot producted together. The resultant single number is fed into binary cross entropy loss where the target is \"do these two item ids follow each other consecutively within some users' activity\". We also introduce negative targets by randomly picking pairs of item ids. (The loss back propagates during training to update the embedding table).</p>\n<p>After training this NN, we have embeddings (extracted from embedding table) for each of the 1.8 million unique items. Next we reduce these embeddings from dimension 32 to dimension 2 with TSNE. Finally for selected users, we plot a sequence of dots in the x-y-plane following their item id activity.</p>",
      "rawMarkdown": "We create embeddings of dimension 32 for each of the 1.8 million unique items. We do this by training a neural network which takes two item ids, then converts them to their embeddings (from embedding table which is being learned and changed during training). Then the two embeddings are dot producted together. The resultant single number is fed into binary cross entropy loss where the target is \"do these two item ids follow each other consecutively within some users' activity\". We also introduce negative targets by randomly picking pairs of item ids. (The loss back propagates during training to update the embedding table).\n\nAfter training this NN, we have embeddings (extracted from embedding table) for each of the 1.8 million unique items. Next we reduce these embeddings from dimension 32 to dimension 2 with TSNE. Finally for selected users, we plot a sequence of dots in the x-y-plane following their item id activity.",
      "votes": null
    },
    {
      "id": "2079626",
      "postDate": "12/29/2022 13:57:21",
      "content": "<p>This figure is very surprising.</p>\n<p>If you don't mind, could you please tell us how you made it?</p>",
      "rawMarkdown": "This figure is very surprising.\n\nIf you don't mind, could you please tell us how you made it?",
      "votes": null
    },
    {
      "id": "2079640",
      "postDate": "12/29/2022 14:08:56",
      "content": "<p>This figures were made in my notebook <a href=\"https://www.kaggle.com/code/cdeotte/user-eda-with-rapids-tsne-and-matrix-factorization\" target=\"_blank\">here</a>. Then for this discussion, i added the blue ovals and letters using Microsoft PowerPoint and took a screen shot.</p>",
      "rawMarkdown": "This figures were made in my notebook [here][1]. Then for this discussion, i added the blue ovals and letters using Microsoft PowerPoint and took a screen shot.\n\n[1]: https://www.kaggle.com/code/cdeotte/user-eda-with-rapids-tsne-and-matrix-factorization",
      "votes": null
    },
    {
      "id": "2079670",
      "postDate": "12/29/2022 14:21:53",
      "content": "<p>Thanks for the great sharing!</p>\n<p>I'll check it out right away!</p>\n<p>You are my guide in this competition!!!</p>",
      "rawMarkdown": "Thanks for the great sharing!\n\nI'll check it out right away!\n\nYou are my guide in this competition!!!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2062091,
      "author_name": "jamnik99",
      "author_url": "",
      "post_date": "12/11/2022 18:02:37",
      "content": "<p>Hi, <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a>! Thanks for the very insightful charts! After several looks at the users' paths, I started thinking whether RecSys, which we are trying to teach/develop, will be predicting the actual AIDs that users want to buy or the AIDs that were recommended to users by the current OTTO's RecSys 😅</p>",
      "votes": null,
      "replies": [
        {
          "id": 2062100,
          "author_name": "cdeotte",
          "author_url": "",
          "post_date": "12/11/2022 18:16:14",
          "content": "<p>Great point Nick. This is true regarding most online prediction tasks. What a user does next depends on what the website shows the user. Our job is basically to predict both. Our \"candidate rerank\" need candidates and rerank logic/model. The candidates are us predicting what Otto will show users and the rerank logic/model is us predicting what the user will select from the options presented.</p>\n<p>(Roughly speaking, matrix factorization and/or co-visitation matrices learn Otto's recsys. And our GBT ranker learns the user's selections)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 2062700,
          "author_name": "pnormann",
          "author_url": "",
          "post_date": "12/12/2022 10:07:02",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/jamnik99\" target=\"_blank\">@jamnik99</a>, although this idea may seem plausible, one should consider that in our case, only about 20% of the product page views are generated by our recommendations, and the majority of the users reach product pages via search results and product lists.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2062718,
      "author_name": "pnormann",
      "author_url": "",
      "post_date": "12/12/2022 10:22:09",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a>, first of all: THIS IS BEAUTIFUL 😍 We want to thank you for your numerous insightful contributions to this competition and your willingness to share your vast knowledge with the community. We are excited about your visualization and are thinking of using a similar approach to improve the explainability of our models to our stakeholders. Keep up the good work! 💪</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2062857,
      "author_name": "ramazannuhbalayev",
      "author_url": "",
      "post_date": "12/12/2022 13:42:13",
      "content": "<p>unbeliavable</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2062914,
      "author_name": "johnostensen",
      "author_url": "",
      "post_date": "12/12/2022 14:15:36",
      "content": "<p>Mind-boggling visualization! This really shows the vastness and complexity of the task we are given here. I was for one minute wondering if you were pulling my leg, and actually posted a picture of cluster of galaxies taken by the James Webb telescope. Anyways, the analogy is not far off. This just goes to show that predicting in this case is maybe more akin to telling a story. Its not just similar products in the category you are in, its also products related in some way in other categories. Lets say you just bought a new apartment, and now you are browsing the OTTO website for new items you need, starting with the essentials. Given enough training, one could imagine a model could learn these different patterns and behaviors over time. Much like OpenAI's LLM's are learning how to write a story from analyzing vast amounts of data. Exiting none the less, and I'm sure some bright minds will revolutionize this space given time and the emerging tools AI provides.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2063025,
          "author_name": "verracodeguacas",
          "author_url": "",
          "post_date": "12/12/2022 15:25:06",
          "content": "<p>If it's a set of galaxies, it must be the aztec warrior constelation <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F820904%2F05cc89325dc7dfa05d249d8171bd62b4%2Faztec.jpeg?generation=1670858690856550&amp;alt=media\" alt=\"\"></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 2063136,
          "author_name": "johnostensen",
          "author_url": "",
          "post_date": "12/12/2022 16:51:56",
          "content": "<p>Yes, must be. How strange the universe is 😄</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2063687,
      "author_name": "nottylerdurden",
      "author_url": "",
      "post_date": "12/13/2022 07:49:52",
      "content": "<p>This is fascinating!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2063962,
      "author_name": "andrejzuba",
      "author_url": "",
      "post_date": "12/13/2022 12:42:56",
      "content": "<p>Beautiful stuff, thanks <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a>!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2068171,
      "author_name": "alejopaullier",
      "author_url": "",
      "post_date": "12/17/2022 15:19:27",
      "content": "<p>Hi Chris, awesome post. One question, since a pivoted user-item table would be immensely large to be applied TSNE you first computed embeddings as a dimensionality reduction technique so then you could effectively apply TSNE on a lower dimensional space? <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a> </p>",
      "votes": null,
      "replies": [
        {
          "id": 2068190,
          "author_name": "cdeotte",
          "author_url": "",
          "post_date": "12/17/2022 15:38:48",
          "content": "<p>We create embeddings of dimension 32 for each of the 1.8 million unique items. We do this by training a neural network which takes two item ids, then converts them to their embeddings (from embedding table which is being learned and changed during training). Then the two embeddings are dot producted together. The resultant single number is fed into binary cross entropy loss where the target is \"do these two item ids follow each other consecutively within some users' activity\". We also introduce negative targets by randomly picking pairs of item ids. (The loss back propagates during training to update the embedding table).</p>\n<p>After training this NN, we have embeddings (extracted from embedding table) for each of the 1.8 million unique items. Next we reduce these embeddings from dimension 32 to dimension 2 with TSNE. Finally for selected users, we plot a sequence of dots in the x-y-plane following their item id activity.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2079626,
      "author_name": "takuma0306",
      "author_url": "",
      "post_date": "12/29/2022 13:57:21",
      "content": "<p>This figure is very surprising.</p>\n<p>If you don't mind, could you please tell us how you made it?</p>",
      "votes": null,
      "replies": [
        {
          "id": 2079640,
          "author_name": "cdeotte",
          "author_url": "",
          "post_date": "12/29/2022 14:08:56",
          "content": "<p>This figures were made in my notebook <a href=\"https://www.kaggle.com/code/cdeotte/user-eda-with-rapids-tsne-and-matrix-factorization\" target=\"_blank\">here</a>. Then for this discussion, i added the blue ovals and letters using Microsoft PowerPoint and took a screen shot.</p>",
          "votes": null,
          "replies": [
            {
              "id": 2079670,
              "author_name": "takuma0306",
              "author_url": "",
              "post_date": "12/29/2022 14:21:53",
              "content": "<p>Thanks for the great sharing!</p>\n<p>I'll check it out right away!</p>\n<p>You are my guide in this competition!!!</p>",
              "votes": null,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2061992": "# Revealing Item Identity with RAPIDS TSNE\nIn Kaggle's Otto competition, there are 12 million unique users and 2 million unique items! Both have anonymized ids, so we don't know what the different items are and we don't know who the users are.\n\nUsing matrix factorization, we can produce meaningful embeddings for items. We can project the embeddings into 2D x-y-plane with RAPIDS TSNE. Then each item is one dot. Below we plot all 2 million items as blue dots.\n\nWhen dots are close to each other (in the x-y-plane) then they are similar items (like both are clothing) and when dots are far from each other they are different items like (one is clothing and the other is electronics).\n\nWe observe clusters of blue dots in the plot below. These are the different categories of items like clothing and electronics.\n\n# The Story of User 13479136\nNow that we have deciphered the category of each item, we understand how users shop. We plot each item that a user interacts with in the 2D x-y-plane. We will plot the dots in chronological order and connect the dots. We now understand user 13479136's behavior!\n\nOn Wednesday Aug 31st, we see that user 13479136 first visits an item in the dark blue oval labeled \"A\" below. They probably saw an ad somewhere on the internet and clicked it. The user likes the Otto website but quickly leaves the category of this initial item and jumps to items in category oval labeled \"B\" below (where we see number 2). The user likes what they see in \"B\", remembers it, and jumps to oval \"C\" (where we see number 3). For numbers 3 thru 10, the user shops in oval \"C\". Then they jump to oval \"D\" for numbers 11 thru 21. So on Wednesday morning at 9am, the user viewed 19 items. Then at 4pm then returned to view 2 more items. All these items were in ovals \"A\", \"B\", \"C\", \"D\" where the majority of the browsing was in ovals \"C\", \"D\".\n\nOn Thursday Sept 1st, user 13479136 returns to Otto website and begins in oval \"C\" and \"D\" for a few clicks then leaves the website. At 3pm, they return and begin to explore oval \"B\" that they remembered from yesterday. They view numbers 27 thru 33. Then leave. At 8pm, they return to view more items back in oval \"C\".\n\nOn Friday Sept 2nd at 9am, they return once more to Otto website and this time explore new items in category oval \"E\". Something attracts their attention because they jump to a different category oval \"F\" to view one item, then put that one item in their cart, and then quickly return back to oval \"E\". What happened here? Was the item from oval \"F\" related to their previous browsing, or did they see something that they remembered they needed to buy, jumped to it, and added it to their cart? Interesting.\n\n![](https://raw.githubusercontent.com/cdeotte/Kaggle_Images/main/Dec-2022/pic1.png)\n\n# The Story of User 13710374\nOn Wednesday Aug 31st, after user 13479136 logs out, we see that user 13710374 logs in to Otto website. They first browse items in category oval \"G\". This is a new category that previous user 13479136 did not explore. User 13710374 likes what they see and puts a few items in their cart. That Wednesday, they leave Otto website without buying anything.\n\nOn Saturday Sep 3rd, user 13710374 returns and visits oval \"C\". This is the same oval \"C\" that user 13479136 visited on 9am Wednesday and 8pm Thursday. User 13710374 likes what they see and adds some items to their cart.\n\n![](https://raw.githubusercontent.com/cdeotte/Kaggle_Images/main/Dec-2022/pic4.png)   \n\n# What Will They Click, Cart, Order Next?\nThe above 2 users are 2 test users. We see the first half of their activity on the week of Aug 29th 2022, what will they click, cart, and order and the second half? Will user 13710374 order the items in their cart? Will user 13479136 return to their previously viewed ovals of \"C\" and \"D\" and order something from there?\n\n# Starter Notebook\nI published a starter notebook [here][1] that allows us to view all users and explore their behavior. Understanding how users traverse Otto website will help us generate better candidates and build better features for our GBT ranker models!\n\n# The Story of User 13096729\nHere is one more user to discuss. User 13096729 has visited Otto website on 7 separate occasions. They visited on Mon Aug29th at 8pm. Then Tue Aug 30rd at 4am, 4pm, 8pm. Then Wed Aug31st at 6pm. Then Thr Sep1st at 4pm and 8pm. Each time they only browse items in category oval \"H\". They have not added anything to their cart nor made any orders. I predict they will visit Otto later in the week and click more items in category \"H\".\n\n![](https://raw.githubusercontent.com/cdeotte/Kaggle_Images/main/Dec-2022/pic6.png)   \n\n[1]: https://www.kaggle.com/code/cdeotte/user-eda-with-rapids-tsne-and-matrix-factorization",
    "2062091": "Hi, @cdeotte! Thanks for the very insightful charts! After several looks at the users' paths, I started thinking whether RecSys, which we are trying to teach/develop, will be predicting the actual AIDs that users want to buy or the AIDs that were recommended to users by the current OTTO's RecSys 😅",
    "2062100": "Great point Nick. This is true regarding most online prediction tasks. What a user does next depends on what the website shows the user. Our job is basically to predict both. Our \"candidate rerank\" need candidates and rerank logic/model. The candidates are us predicting what Otto will show users and the rerank logic/model is us predicting what the user will select from the options presented.\n\n(Roughly speaking, matrix factorization and/or co-visitation matrices learn Otto's recsys. And our GBT ranker learns the user's selections)",
    "2062700": "Hi @jamnik99, although this idea may seem plausible, one should consider that in our case, only about 20% of the product page views are generated by our recommendations, and the majority of the users reach product pages via search results and product lists.",
    "2062718": "Hi @cdeotte, first of all: THIS IS BEAUTIFUL 😍 We want to thank you for your numerous insightful contributions to this competition and your willingness to share your vast knowledge with the community. We are excited about your visualization and are thinking of using a similar approach to improve the explainability of our models to our stakeholders. Keep up the good work! 💪",
    "2062857": "unbeliavable",
    "2062914": "Mind-boggling visualization! This really shows the vastness and complexity of the task we are given here. I was for one minute wondering if you were pulling my leg, and actually posted a picture of cluster of galaxies taken by the James Webb telescope. Anyways, the analogy is not far off. This just goes to show that predicting in this case is maybe more akin to telling a story. Its not just similar products in the category you are in, its also products related in some way in other categories. Lets say you just bought a new apartment, and now you are browsing the OTTO website for new items you need, starting with the essentials. Given enough training, one could imagine a model could learn these different patterns and behaviors over time. Much like OpenAI's LLM's are learning how to write a story from analyzing vast amounts of data. Exiting none the less, and I'm sure some bright minds will revolutionize this space given time and the emerging tools AI provides.",
    "2063025": "If it's a set of galaxies, it must be the aztec warrior constelation ![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F820904%2F05cc89325dc7dfa05d249d8171bd62b4%2Faztec.jpeg?generation=1670858690856550&alt=media)",
    "2063136": "Yes, must be. How strange the universe is 😄",
    "2063687": "This is fascinating!",
    "2063962": "Beautiful stuff, thanks @cdeotte!",
    "2068171": "Hi Chris, awesome post. One question, since a pivoted user-item table would be immensely large to be applied TSNE you first computed embeddings as a dimensionality reduction technique so then you could effectively apply TSNE on a lower dimensional space? @cdeotte",
    "2068190": "We create embeddings of dimension 32 for each of the 1.8 million unique items. We do this by training a neural network which takes two item ids, then converts them to their embeddings (from embedding table which is being learned and changed during training). Then the two embeddings are dot producted together. The resultant single number is fed into binary cross entropy loss where the target is \"do these two item ids follow each other consecutively within some users' activity\". We also introduce negative targets by randomly picking pairs of item ids. (The loss back propagates during training to update the embedding table).\n\nAfter training this NN, we have embeddings (extracted from embedding table) for each of the 1.8 million unique items. Next we reduce these embeddings from dimension 32 to dimension 2 with TSNE. Finally for selected users, we plot a sequence of dots in the x-y-plane following their item id activity.",
    "2079626": "This figure is very surprising.\n\nIf you don't mind, could you please tell us how you made it?",
    "2079640": "This figures were made in my notebook [here][1]. Then for this discussion, i added the blue ovals and letters using Microsoft PowerPoint and took a screen shot.\n\n[1]: https://www.kaggle.com/code/cdeotte/user-eda-with-rapids-tsne-and-matrix-factorization",
    "2079670": "Thanks for the great sharing!\n\nI'll check it out right away!\n\nYou are my guide in this competition!!!"
  },
  "source": "meta"
}