{
  "id": 382829,
  "title": "70-th Place Solution : Everything done on Kaggle",
  "url": "/competitions/otto-recommender-system/discussion/382829",
  "author_name": "Pietro Maldini",
  "post_date": "2023-02-01T06:27:23.268000",
  "votes": 17,
  "comment_count": 0,
  "views": 0,
  "content": "<p>This challenge was fun and I hope everyone enjoyed it.<br>\nIn this post I’ll try to explain my approach used to reach this position.</p>\n<h1>The start</h1>\n<p>Once I entered this competition I suddenly saw that in the first days there were already really good scores in the leaderboard and many co-visitation based notebooks.<br>\nI started by working on those notebook s and published this <a href=\"https://www.kaggle.com/code/pietromaldini1/multiple-clicks-vs-latest-items\" target=\"_blank\">notebook</a> where I presented some ideas to improve the logic used by many particiapants. At the beginning there were many interactions and many ideas flowing between participants. </p>\n<h1>What I did</h1>\n<p>I worked on public notebooks and tried to learn the approaches of many participants to improve my knowledge and I used this challenge to get used with Weight &amp; Biases that I used to tune the parameters of many models.</p>\n<h1>My solution</h1>\n<p>My solution is divided into 2 parts candidate generation and re-ranking.</p>\n<h1>Candidate generation</h1>\n<p>My main candidate selectors are shared models by other participants I used  <a href=\"https://www.kaggle.com/code/carnozhao/otto-fast-cpu-end-to-end-pipeline\" target=\"_blank\">co-visitation</a> , <a href=\"https://www.kaggle.com/code/cpmpml/matrix-factorization-with-gpu\" target=\"_blank\">MF</a>, <a href=\"https://www.kaggle.com/code/radek1/word2vec-how-to-training-and-submission\" target=\"_blank\">W2V</a> and SRGNN using the RecBole library based on this <a href=\"https://www.kaggle.com/code/yamsam/recbole-gru4rec-sample-code\" target=\"_blank\">notebook</a>.<br>\nOther candidate selector I used are different weighting of session history since in this competition many user interact with items they already interacted with in the past.</p>\n<h2>Re ranking</h2>\n<p>For re ranking I used LGBM Classifier models, one for each interaction type.<br>\nI tried using also LGBM Rankers and Catboost Ranker but for the lack of time to tune them I got worse results with those models.<br>\nAs training data for the Classifiers I used the scores given by each candidate generator and simple features.<br>\nFor each candidate how many times it already appeared in the session for each type of interaction and the sum of this 3 counts, the length of the session (number of items) and the temporal length of the session (just now I'm thinking that I forgot to also add the count of unique items seen in the session).<br>\nOther features I used are Target Encodings for each interaction type and a weighted sum of them trained on the week before the test set and target encoding trained on the test week ( for training the models I used the Target encodings calculated on the week before the validation week and encoding calculated on the validation week itself).</p>\n<h2>Results</h2>\n<p>My LGBM classifiers together (<a href=\"https://www.kaggle.com/code/pietromaldini1/82-nd-position-lgbm-final-prediction\" target=\"_blank\">notebook</a>) got me a score of 0.58744 in public leaderboard and of 0.58746 in private leaderboard.<br>\nMy best single model was a tuned co-visitation based approach (<a href=\"https://www.kaggle.com/pietromaldini1/otto-best-single-model-tuned-co-visit\" target=\"_blank\">notebook</a>) with exponential weight decay and computed only between items temporally close between each other and it got a score of 0.58126 in public leaderboard and of 0.58133  in private leaderboard.</p>\n<h2>Conclusions</h2>\n<p>This weekend I’ll try and read other participants’ solutions, I’m looking forward to see many interesting approaches I never thought about. I’ll try also to polish and improve this post and my shared notebooks<br>\nI want to learn and improve to get even better results the next time.</p>\n<p>Feel free to get in touch with me on LinkedIn and if you are interested also check my github and the solution of my team in RecSys Challenge 2022, find the links in my Kaggle profile.</p>\n<p>Keep kaggling and enjoy! </p>",
  "messages": [
    {
      "id": 2124677,
      "postDate": "2023-02-01T06:27:23.270Z",
      "content": "<p>This challenge was fun and I hope everyone enjoyed it.<br>\nIn this post I’ll try to explain my approach used to reach this position.</p>\n<h1>The start</h1>\n<p>Once I entered this competition I suddenly saw that in the first days there were already really good scores in the leaderboard and many co-visitation based notebooks.<br>\nI started by working on those notebook s and published this <a href=\"https://www.kaggle.com/code/pietromaldini1/multiple-clicks-vs-latest-items\" target=\"_blank\">notebook</a> where I presented some ideas to improve the logic used by many particiapants. At the beginning there were many interactions and many ideas flowing between participants. </p>\n<h1>What I did</h1>\n<p>I worked on public notebooks and tried to learn the approaches of many participants to improve my knowledge and I used this challenge to get used with Weight &amp; Biases that I used to tune the parameters of many models.</p>\n<h1>My solution</h1>\n<p>My solution is divided into 2 parts candidate generation and re-ranking.</p>\n<h1>Candidate generation</h1>\n<p>My main candidate selectors are shared models by other participants I used  <a href=\"https://www.kaggle.com/code/carnozhao/otto-fast-cpu-end-to-end-pipeline\" target=\"_blank\">co-visitation</a> , <a href=\"https://www.kaggle.com/code/cpmpml/matrix-factorization-with-gpu\" target=\"_blank\">MF</a>, <a href=\"https://www.kaggle.com/code/radek1/word2vec-how-to-training-and-submission\" target=\"_blank\">W2V</a> and SRGNN using the RecBole library based on this <a href=\"https://www.kaggle.com/code/yamsam/recbole-gru4rec-sample-code\" target=\"_blank\">notebook</a>.<br>\nOther candidate selector I used are different weighting of session history since in this competition many user interact with items they already interacted with in the past.</p>\n<h2>Re ranking</h2>\n<p>For re ranking I used LGBM Classifier models, one for each interaction type.<br>\nI tried using also LGBM Rankers and Catboost Ranker but for the lack of time to tune them I got worse results with those models.<br>\nAs training data for the Classifiers I used the scores given by each candidate generator and simple features.<br>\nFor each candidate how many times it already appeared in the session for each type of interaction and the sum of this 3 counts, the length of the session (number of items) and the temporal length of the session (just now I'm thinking that I forgot to also add the count of unique items seen in the session).<br>\nOther features I used are Target Encodings for each interaction type and a weighted sum of them trained on the week before the test set and target encoding trained on the test week ( for training the models I used the Target encodings calculated on the week before the validation week and encoding calculated on the validation week itself).</p>\n<h2>Results</h2>\n<p>My LGBM classifiers together (<a href=\"https://www.kaggle.com/code/pietromaldini1/82-nd-position-lgbm-final-prediction\" target=\"_blank\">notebook</a>) got me a score of 0.58744 in public leaderboard and of 0.58746 in private leaderboard.<br>\nMy best single model was a tuned co-visitation based approach (<a href=\"https://www.kaggle.com/pietromaldini1/otto-best-single-model-tuned-co-visit\" target=\"_blank\">notebook</a>) with exponential weight decay and computed only between items temporally close between each other and it got a score of 0.58126 in public leaderboard and of 0.58133  in private leaderboard.</p>\n<h2>Conclusions</h2>\n<p>This weekend I’ll try and read other participants’ solutions, I’m looking forward to see many interesting approaches I never thought about. I’ll try also to polish and improve this post and my shared notebooks<br>\nI want to learn and improve to get even better results the next time.</p>\n<p>Feel free to get in touch with me on LinkedIn and if you are interested also check my github and the solution of my team in RecSys Challenge 2022, find the links in my Kaggle profile.</p>\n<p>Keep kaggling and enjoy! </p>",
      "rawMarkdown": "This challenge was fun and I hope everyone enjoyed it.\nIn this post I’ll try to explain my approach used to reach this position.\n\n# The start\nOnce I entered this competition I suddenly saw that in the first days there were already really good scores in the leaderboard and many co-visitation based notebooks.\nI started by working on those notebook s and published this [notebook]( https://www.kaggle.com/code/pietromaldini1/multiple-clicks-vs-latest-items) where I presented some ideas to improve the logic used by many particiapants. At the beginning there were many interactions and many ideas flowing between participants. \n\n# What I did\nI worked on public notebooks and tried to learn the approaches of many participants to improve my knowledge and I used this challenge to get used with Weight & Biases that I used to tune the parameters of many models.\n\n# My solution\nMy solution is divided into 2 parts candidate generation and re-ranking.\n\n# Candidate generation\nMy main candidate selectors are shared models by other participants I used  [co-visitation] (https://www.kaggle.com/code/carnozhao/otto-fast-cpu-end-to-end-pipeline) , [MF]( https://www.kaggle.com/code/cpmpml/matrix-factorization-with-gpu), [W2V]( https://www.kaggle.com/code/radek1/word2vec-how-to-training-and-submission) and SRGNN using the RecBole library based on this [notebook]( https://www.kaggle.com/code/yamsam/recbole-gru4rec-sample-code).\nOther candidate selector I used are different weighting of session history since in this competition many user interact with items they already interacted with in the past.\n\n## Re ranking\nFor re ranking I used LGBM Classifier models, one for each interaction type.\nI tried using also LGBM Rankers and Catboost Ranker but for the lack of time to tune them I got worse results with those models.\nAs training data for the Classifiers I used the scores given by each candidate generator and simple features.\nFor each candidate how many times it already appeared in the session for each type of interaction and the sum of this 3 counts, the length of the session (number of items) and the temporal length of the session (just now I'm thinking that I forgot to also add the count of unique items seen in the session).\nOther features I used are Target Encodings for each interaction type and a weighted sum of them trained on the week before the test set and target encoding trained on the test week ( for training the models I used the Target encodings calculated on the week before the validation week and encoding calculated on the validation week itself).\n\n## Results\nMy LGBM classifiers together ([notebook](https://www.kaggle.com/code/pietromaldini1/82-nd-position-lgbm-final-prediction )) got me a score of 0.58744 in public leaderboard and of 0.58746 in private leaderboard.\nMy best single model was a tuned co-visitation based approach ([notebook]( https://www.kaggle.com/pietromaldini1/otto-best-single-model-tuned-co-visit)) with exponential weight decay and computed only between items temporally close between each other and it got a score of 0.58126 in public leaderboard and of 0.58133  in private leaderboard.\n\n## Conclusions\nThis weekend I’ll try and read other participants’ solutions, I’m looking forward to see many interesting approaches I never thought about. I’ll try also to polish and improve this post and my shared notebooks\nI want to learn and improve to get even better results the next time.\n\nFeel free to get in touch with me on LinkedIn and if you are interested also check my github and the solution of my team in RecSys Challenge 2022, find the links in my Kaggle profile.\n\nKeep kaggling and enjoy! \n",
      "votes": 17
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "2124677": "This challenge was fun and I hope everyone enjoyed it.\nIn this post I’ll try to explain my approach used to reach this position.\n\n# The start\nOnce I entered this competition I suddenly saw that in the first days there were already really good scores in the leaderboard and many co-visitation based notebooks.\nI started by working on those notebook s and published this [notebook]( https://www.kaggle.com/code/pietromaldini1/multiple-clicks-vs-latest-items) where I presented some ideas to improve the logic used by many particiapants. At the beginning there were many interactions and many ideas flowing between participants. \n\n# What I did\nI worked on public notebooks and tried to learn the approaches of many participants to improve my knowledge and I used this challenge to get used with Weight & Biases that I used to tune the parameters of many models.\n\n# My solution\nMy solution is divided into 2 parts candidate generation and re-ranking.\n\n# Candidate generation\nMy main candidate selectors are shared models by other participants I used  [co-visitation] (https://www.kaggle.com/code/carnozhao/otto-fast-cpu-end-to-end-pipeline) , [MF]( https://www.kaggle.com/code/cpmpml/matrix-factorization-with-gpu), [W2V]( https://www.kaggle.com/code/radek1/word2vec-how-to-training-and-submission) and SRGNN using the RecBole library based on this [notebook]( https://www.kaggle.com/code/yamsam/recbole-gru4rec-sample-code).\nOther candidate selector I used are different weighting of session history since in this competition many user interact with items they already interacted with in the past.\n\n## Re ranking\nFor re ranking I used LGBM Classifier models, one for each interaction type.\nI tried using also LGBM Rankers and Catboost Ranker but for the lack of time to tune them I got worse results with those models.\nAs training data for the Classifiers I used the scores given by each candidate generator and simple features.\nFor each candidate how many times it already appeared in the session for each type of interaction and the sum of this 3 counts, the length of the session (number of items) and the temporal length of the session (just now I'm thinking that I forgot to also add the count of unique items seen in the session).\nOther features I used are Target Encodings for each interaction type and a weighted sum of them trained on the week before the test set and target encoding trained on the test week ( for training the models I used the Target encodings calculated on the week before the validation week and encoding calculated on the validation week itself).\n\n## Results\nMy LGBM classifiers together ([notebook](https://www.kaggle.com/code/pietromaldini1/82-nd-position-lgbm-final-prediction )) got me a score of 0.58744 in public leaderboard and of 0.58746 in private leaderboard.\nMy best single model was a tuned co-visitation based approach ([notebook]( https://www.kaggle.com/pietromaldini1/otto-best-single-model-tuned-co-visit)) with exponential weight decay and computed only between items temporally close between each other and it got a score of 0.58126 in public leaderboard and of 0.58133  in private leaderboard.\n\n## Conclusions\nThis weekend I’ll try and read other participants’ solutions, I’m looking forward to see many interesting approaches I never thought about. I’ll try also to polish and improve this post and my shared notebooks\nI want to learn and improve to get even better results the next time.\n\nFeel free to get in touch with me on LinkedIn and if you are interested also check my github and the solution of my team in RecSys Challenge 2022, find the links in my Kaggle profile.\n\nKeep kaggling and enjoy! \n"
  }
}