{
  "id": 382783,
  "title": "5th place (yet) solution (Carno & 2U & Jiahong's part)",
  "url": "/competitions/otto-recommender-system/writeups/cwktj-5th-place-yet-solution-carno-2u-jiahong-s-pa",
  "author_name": "",
  "post_date": "2023-02-01T15:45:05.143Z",
  "votes": 38,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Same as other competitors who benefit from <a href=\"https://www.kaggle.com/radek1\" target=\"_blank\">@radek1</a> and <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a>, we thank their great devotion to this competition. We'd also like to thank the organizers and Kaggle, and I hope what happened in this competition will end up with a satisfactory endding.</p>\n<h2>TL; DR</h2>\n<p>Our solution is a combination version from two teams' previous solutions. Before team-merge, our train-valid splits, recall methods, feature sets and rerank models are all different. We not only simply ensemble our independent submission files, but also exchange features for further improvement.</p>\n<h2>Ensemble</h2>\n<p>Here, we use lower case letters to denote a submission version <strong>(a, b, …)</strong>, which can be the 5-fold ensemble of one reranker, or an ensemble of two or more submissions. <strong>S1</strong> and <strong>S2</strong> are public validation data split and private regenerated validation data split. <strong>R1</strong> and <strong>R2</strong> are two different recall methods. <strong>F1</strong> and <strong>F2</strong> are two different feature sets, and <strong>F'1</strong> and <strong>F'2</strong> are the important feature sub-sets. <strong>XGB</strong> and <strong>CBT</strong> denotes xgboost binary classifier and catboost ranker. <strong>\"+\"</strong> denotes score ensemble, which means we average the raw output from multiple model to rerank candidates. <strong>\"&amp;\"</strong> denotes index ensemble, which means we assign index-score for the first 20 candidates from 1.00 to 0.05, with 0.05 step, and then we use the summation of index-scores to rerank candidates. <strong>\"*\"</strong> denotes weight during ensemble.<br>\nOur final solution <strong><em>i</em></strong> whould be:<br>\n<strong><em>c</em></strong> = a * 0.45 &amp; b * 0.575 <br>\n<strong><em>d</em></strong> = d1 * 0.5 + d2 * 0.5 <br>\n<strong><em>e</em></strong> = e1 * 0.5 + e2 * 0.5 <br>\n<strong><em>g</em></strong> = c * 0.5 &amp; d * 0.4 &amp; e * 0.6 <br>\n<strong><em>h</em></strong> = (c * 0.5 &amp; d * 0.5) &amp; f * 0.5 <br>\n<strong><em>i</em></strong> = g * 0.6 &amp; h * 0.5</p>\n<table>\n<thead>\n<tr>\n<th></th>\n<th>data splits</th>\n<th>recall methods</th>\n<th>feature set</th>\n<th>model</th>\n<th>importance feature set</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>a</td>\n<td>S1</td>\n<td>R1</td>\n<td>F1</td>\n<td>CBT</td>\n<td>F1', F1''</td>\n</tr>\n<tr>\n<td>b</td>\n<td>S2</td>\n<td>R2</td>\n<td>F2</td>\n<td>XGB</td>\n<td>F2'</td>\n</tr>\n<tr>\n<td>d1, d2</td>\n<td>S2</td>\n<td>R1</td>\n<td>F1+F2'</td>\n<td>XBG, CBT</td>\n<td></td>\n</tr>\n<tr>\n<td>e1, e2</td>\n<td>S2</td>\n<td>R2</td>\n<td>F2+F1'</td>\n<td>XBG, CBT</td>\n<td></td>\n</tr>\n<tr>\n<td>f</td>\n<td>S2</td>\n<td>R2</td>\n<td>F2+F1''</td>\n<td>CBT</td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h2>Recall methods</h2>\n<h3>R1</h3>\n<p>This recall methods is developed based on public co-visitation matrix notebook (4 matrix: clicks, carts, orders and buy2buy), and optimized by numba. The detailed numbers will be released with code.</p>\n<h3>R2</h3>\n<p>PLACEHOLDER</p>\n<h2>Feature set</h2>\n<h3>F1</h3>\n<p>F1 includes statistical features and model trained features. Same as most teams, we use sum, max, min and mean of interaction history and co-visitation score to summarize the sessions, the items and the interactions. The importances of most statistical features are not significant.<br>\nIn trained features, we used BPR, ALS and LMF from <code>implicit</code> package, W2V from <code>gensim</code> package and <a href=\"https://www.kaggle.com/competitions/otto-recommender-system/discussion/382783#2124459\" target=\"_blank\">SAS</a>. In all algorithms mentioned here, we can get the embedding of items, so we use the inner product of candidate embedding and session latest average embedding as interaction features. In BPR, ALS, and LMF, we can get the embedding of both sessions and items, so we additionally use the inner product of session embedding and candidate embedding as interaction features. </p>\n<h3>F2</h3>\n<p>PLACEHOLDER</p>\n<h3>Importance</h3>\n<p>We use feature importance from reranker model to decide which features to exchange.</p>",
  "messages": [
    {
      "id": "2124420",
      "postDate": "02/01/2023 01:52:46",
      "content": "<p>Same as other competitors who benefit from <a href=\"https://www.kaggle.com/radek1\" target=\"_blank\">@radek1</a> and <a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a>, we thank their great devotion to this competition. We'd also like to thank the organizers and Kaggle, and I hope what happened in this competition will end up with a satisfactory endding.</p>\n<h2>TL; DR</h2>\n<p>Our solution is a combination version from two teams' previous solutions. Before team-merge, our train-valid splits, recall methods, feature sets and rerank models are all different. We not only simply ensemble our independent submission files, but also exchange features for further improvement.</p>\n<h2>Ensemble</h2>\n<p>Here, we use lower case letters to denote a submission version <strong>(a, b, …)</strong>, which can be the 5-fold ensemble of one reranker, or an ensemble of two or more submissions. <strong>S1</strong> and <strong>S2</strong> are public validation data split and private regenerated validation data split. <strong>R1</strong> and <strong>R2</strong> are two different recall methods. <strong>F1</strong> and <strong>F2</strong> are two different feature sets, and <strong>F'1</strong> and <strong>F'2</strong> are the important feature sub-sets. <strong>XGB</strong> and <strong>CBT</strong> denotes xgboost binary classifier and catboost ranker. <strong>\"+\"</strong> denotes score ensemble, which means we average the raw output from multiple model to rerank candidates. <strong>\"&amp;\"</strong> denotes index ensemble, which means we assign index-score for the first 20 candidates from 1.00 to 0.05, with 0.05 step, and then we use the summation of index-scores to rerank candidates. <strong>\"*\"</strong> denotes weight during ensemble.<br>\nOur final solution <strong><em>i</em></strong> whould be:<br>\n<strong><em>c</em></strong> = a * 0.45 &amp; b * 0.575 <br>\n<strong><em>d</em></strong> = d1 * 0.5 + d2 * 0.5 <br>\n<strong><em>e</em></strong> = e1 * 0.5 + e2 * 0.5 <br>\n<strong><em>g</em></strong> = c * 0.5 &amp; d * 0.4 &amp; e * 0.6 <br>\n<strong><em>h</em></strong> = (c * 0.5 &amp; d * 0.5) &amp; f * 0.5 <br>\n<strong><em>i</em></strong> = g * 0.6 &amp; h * 0.5</p>\n<table>\n<thead>\n<tr>\n<th></th>\n<th>data splits</th>\n<th>recall methods</th>\n<th>feature set</th>\n<th>model</th>\n<th>importance feature set</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>a</td>\n<td>S1</td>\n<td>R1</td>\n<td>F1</td>\n<td>CBT</td>\n<td>F1', F1''</td>\n</tr>\n<tr>\n<td>b</td>\n<td>S2</td>\n<td>R2</td>\n<td>F2</td>\n<td>XGB</td>\n<td>F2'</td>\n</tr>\n<tr>\n<td>d1, d2</td>\n<td>S2</td>\n<td>R1</td>\n<td>F1+F2'</td>\n<td>XBG, CBT</td>\n<td></td>\n</tr>\n<tr>\n<td>e1, e2</td>\n<td>S2</td>\n<td>R2</td>\n<td>F2+F1'</td>\n<td>XBG, CBT</td>\n<td></td>\n</tr>\n<tr>\n<td>f</td>\n<td>S2</td>\n<td>R2</td>\n<td>F2+F1''</td>\n<td>CBT</td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h2>Recall methods</h2>\n<h3>R1</h3>\n<p>This recall methods is developed based on public co-visitation matrix notebook (4 matrix: clicks, carts, orders and buy2buy), and optimized by numba. The detailed numbers will be released with code.</p>\n<h3>R2</h3>\n<p>PLACEHOLDER</p>\n<h2>Feature set</h2>\n<h3>F1</h3>\n<p>F1 includes statistical features and model trained features. Same as most teams, we use sum, max, min and mean of interaction history and co-visitation score to summarize the sessions, the items and the interactions. The importances of most statistical features are not significant.<br>\nIn trained features, we used BPR, ALS and LMF from <code>implicit</code> package, W2V from <code>gensim</code> package and <a href=\"https://www.kaggle.com/competitions/otto-recommender-system/discussion/382783#2124459\" target=\"_blank\">SAS</a>. In all algorithms mentioned here, we can get the embedding of items, so we use the inner product of candidate embedding and session latest average embedding as interaction features. In BPR, ALS, and LMF, we can get the embedding of both sessions and items, so we additionally use the inner product of session embedding and candidate embedding as interaction features. </p>\n<h3>F2</h3>\n<p>PLACEHOLDER</p>\n<h3>Importance</h3>\n<p>We use feature importance from reranker model to decide which features to exchange.</p>",
      "rawMarkdown": "Same as other competitors who benefit from @radek1 and @cdeotte, we thank their great devotion to this competition. We'd also like to thank the organizers and Kaggle, and I hope what happened in this competition will end up with a satisfactory endding.\n\n## TL; DR\n\nOur solution is a combination version from two teams' previous solutions. Before team-merge, our train-valid splits, recall methods, feature sets and rerank models are all different. We not only simply ensemble our independent submission files, but also exchange features for further improvement.\n\n## Ensemble\n\nHere, we use lower case letters to denote a submission version **(a, b, ...)**, which can be the 5-fold ensemble of one reranker, or an ensemble of two or more submissions. **S1** and **S2** are public validation data split and private regenerated validation data split. **R1** and **R2** are two different recall methods. **F1** and **F2** are two different feature sets, and **F'1** and **F'2** are the important feature sub-sets. **XGB** and **CBT** denotes xgboost binary classifier and catboost ranker. **\"+\"** denotes score ensemble, which means we average the raw output from multiple model to rerank candidates. **\"&\"** denotes index ensemble, which means we assign index-score for the first 20 candidates from 1.00 to 0.05, with 0.05 step, and then we use the summation of index-scores to rerank candidates. **\"*\"** denotes weight during ensemble.\n\nOur final solution ***i*** whould be:\n\n\n***c*** = a * 0.45 & b * 0.575 \n***d*** = d1 * 0.5 + d2 * 0.5 \n***e*** = e1 * 0.5 + e2 * 0.5 \n***g*** = c * 0.5 & d * 0.4 & e * 0.6 \n***h*** = (c * 0.5 & d * 0.5) & f * 0.5 \n***i*** = g * 0.6 & h * 0.5\n\n\n\n|        | data splits | recall methods | feature set | model    | importance feature set |\n|--------|-------------|----------------|-------------|----------|------------------------|\n| a      | S1          | R1             | F1          | CBT      | F1', F1''              |\n| b      | S2          | R2             | F2          | XGB      | F2'                    |\n| d1, d2 | S2          | R1             | F1+F2'      | XBG, CBT |                        |\n| e1, e2 | S2          | R2             | F2+F1'      | XBG, CBT |                        |\n| f      | S2          | R2             | F2+F1''     | CBT      |                        |\n\n## Recall methods\n\n### R1\n\nThis recall methods is developed based on public co-visitation matrix notebook (4 matrix: clicks, carts, orders and buy2buy), and optimized by numba. The detailed numbers will be released with code.\n\n### R2\n\nPLACEHOLDER\n\n## Feature set\n\n### F1\n\nF1 includes statistical features and model trained features. Same as most teams, we use sum, max, min and mean of interaction history and co-visitation score to summarize the sessions, the items and the interactions. The importances of most statistical features are not significant.\n\nIn trained features, we used BPR, ALS and LMF from `implicit` package, W2V from `gensim` package and [SAS](https://www.kaggle.com/competitions/otto-recommender-system/discussion/382783#2124459). In all algorithms mentioned here, we can get the embedding of items, so we use the inner product of candidate embedding and session latest average embedding as interaction features. In BPR, ALS, and LMF, we can get the embedding of both sessions and items, so we additionally use the inner product of session embedding and candidate embedding as interaction features. \n\n### F2\n\nPLACEHOLDER\n\n### Importance\n\nWe use feature importance from reranker model to decide which features to exchange.",
      "votes": null
    },
    {
      "id": "2124426",
      "postDate": "02/01/2023 01:57:31",
      "content": "<p>It'd be nice if folks posting solutions gave some credit to the rest of their teammates.  Perhaps mention some of their important contributions for folks who come later and want to evaluate them as a potential teammate.</p>",
      "rawMarkdown": "It'd be nice if folks posting solutions gave some credit to the rest of their teammates.  Perhaps mention some of their important contributions for folks who come later and want to evaluate them as a potential teammate.",
      "votes": null
    },
    {
      "id": "2124433",
      "postDate": "02/01/2023 02:03:32",
      "content": "<p>Its a good idea. 😄 I'd like to say all my teammates are unique and irreplaceable. All of us work hard together to get such a high rank in this competition.</p>",
      "rawMarkdown": "Its a good idea. 😄 I'd like to say all my teammates are unique and irreplaceable. All of us work hard together to get such a high rank in this competition.",
      "votes": null
    },
    {
      "id": "2124459",
      "postDate": "02/01/2023 02:38:27",
      "content": "<p>Supplement: original <a href=\"https://cseweb.ucsd.edu/~jmcauley/pdfs/icdm18.pdf\" target=\"_blank\">SAS</a> without type(click,cart,and order), we add type like bert through type embedding and call it SAST.  Features of SAST mainly contain three parts:1. no type and no posistion embedding score; 2. type and no posistion embedding score. 3. type and posistion embedding score. In this competition, I learn a lot from my teammates in both coding and ideas. Thanks a lot!</p>",
      "rawMarkdown": "Supplement: original [SAS](https://cseweb.ucsd.edu/~jmcauley/pdfs/icdm18.pdf) without type(click,cart,and order), we add type like bert through type embedding and call it SAST.  Features of SAST mainly contain three parts:1. no type and no posistion embedding score; 2. type and no posistion embedding score. 3. type and posistion embedding score. In this competition, I learn a lot from my teammates in both coding and ideas. Thanks a lot!",
      "votes": null
    },
    {
      "id": "2124651",
      "postDate": "02/01/2023 05:56:53",
      "content": "<p>Will you open source your code later? Want to learn the details of the plan</p>",
      "rawMarkdown": "Will you open source your code later? Want to learn the details of the plan",
      "votes": null
    },
    {
      "id": "2124655",
      "postDate": "02/01/2023 06:00:11",
      "content": "<p>As you can see, the whole pipeline of our solution is complex. Probably I will only release my recall part (co-visitation based).</p>",
      "rawMarkdown": "As you can see, the whole pipeline of our solution is complex. Probably I will only release my recall part (co-visitation based).",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2124426,
      "author_name": "kaggleqrdl",
      "author_url": "",
      "post_date": "02/01/2023 01:57:31",
      "content": "<p>It'd be nice if folks posting solutions gave some credit to the rest of their teammates.  Perhaps mention some of their important contributions for folks who come later and want to evaluate them as a potential teammate.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2124433,
          "author_name": "carnozhao",
          "author_url": "",
          "post_date": "02/01/2023 02:03:32",
          "content": "<p>Its a good idea. 😄 I'd like to say all my teammates are unique and irreplaceable. All of us work hard together to get such a high rank in this competition.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2124459,
      "author_name": "toyou2u",
      "author_url": "",
      "post_date": "02/01/2023 02:38:27",
      "content": "<p>Supplement: original <a href=\"https://cseweb.ucsd.edu/~jmcauley/pdfs/icdm18.pdf\" target=\"_blank\">SAS</a> without type(click,cart,and order), we add type like bert through type embedding and call it SAST.  Features of SAST mainly contain three parts:1. no type and no posistion embedding score; 2. type and no posistion embedding score. 3. type and posistion embedding score. In this competition, I learn a lot from my teammates in both coding and ideas. Thanks a lot!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2124651,
      "author_name": "yasso1",
      "author_url": "",
      "post_date": "02/01/2023 05:56:53",
      "content": "<p>Will you open source your code later? Want to learn the details of the plan</p>",
      "votes": null,
      "replies": [
        {
          "id": 2124655,
          "author_name": "carnozhao",
          "author_url": "",
          "post_date": "02/01/2023 06:00:11",
          "content": "<p>As you can see, the whole pipeline of our solution is complex. Probably I will only release my recall part (co-visitation based).</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2124420": "Same as other competitors who benefit from @radek1 and @cdeotte, we thank their great devotion to this competition. We'd also like to thank the organizers and Kaggle, and I hope what happened in this competition will end up with a satisfactory endding.\n\n## TL; DR\n\nOur solution is a combination version from two teams' previous solutions. Before team-merge, our train-valid splits, recall methods, feature sets and rerank models are all different. We not only simply ensemble our independent submission files, but also exchange features for further improvement.\n\n## Ensemble\n\nHere, we use lower case letters to denote a submission version **(a, b, ...)**, which can be the 5-fold ensemble of one reranker, or an ensemble of two or more submissions. **S1** and **S2** are public validation data split and private regenerated validation data split. **R1** and **R2** are two different recall methods. **F1** and **F2** are two different feature sets, and **F'1** and **F'2** are the important feature sub-sets. **XGB** and **CBT** denotes xgboost binary classifier and catboost ranker. **\"+\"** denotes score ensemble, which means we average the raw output from multiple model to rerank candidates. **\"&\"** denotes index ensemble, which means we assign index-score for the first 20 candidates from 1.00 to 0.05, with 0.05 step, and then we use the summation of index-scores to rerank candidates. **\"*\"** denotes weight during ensemble.\n\nOur final solution ***i*** whould be:\n\n\n***c*** = a * 0.45 & b * 0.575 \n***d*** = d1 * 0.5 + d2 * 0.5 \n***e*** = e1 * 0.5 + e2 * 0.5 \n***g*** = c * 0.5 & d * 0.4 & e * 0.6 \n***h*** = (c * 0.5 & d * 0.5) & f * 0.5 \n***i*** = g * 0.6 & h * 0.5\n\n\n\n|        | data splits | recall methods | feature set | model    | importance feature set |\n|--------|-------------|----------------|-------------|----------|------------------------|\n| a      | S1          | R1             | F1          | CBT      | F1', F1''              |\n| b      | S2          | R2             | F2          | XGB      | F2'                    |\n| d1, d2 | S2          | R1             | F1+F2'      | XBG, CBT |                        |\n| e1, e2 | S2          | R2             | F2+F1'      | XBG, CBT |                        |\n| f      | S2          | R2             | F2+F1''     | CBT      |                        |\n\n## Recall methods\n\n### R1\n\nThis recall methods is developed based on public co-visitation matrix notebook (4 matrix: clicks, carts, orders and buy2buy), and optimized by numba. The detailed numbers will be released with code.\n\n### R2\n\nPLACEHOLDER\n\n## Feature set\n\n### F1\n\nF1 includes statistical features and model trained features. Same as most teams, we use sum, max, min and mean of interaction history and co-visitation score to summarize the sessions, the items and the interactions. The importances of most statistical features are not significant.\n\nIn trained features, we used BPR, ALS and LMF from `implicit` package, W2V from `gensim` package and [SAS](https://www.kaggle.com/competitions/otto-recommender-system/discussion/382783#2124459). In all algorithms mentioned here, we can get the embedding of items, so we use the inner product of candidate embedding and session latest average embedding as interaction features. In BPR, ALS, and LMF, we can get the embedding of both sessions and items, so we additionally use the inner product of session embedding and candidate embedding as interaction features. \n\n### F2\n\nPLACEHOLDER\n\n### Importance\n\nWe use feature importance from reranker model to decide which features to exchange.",
    "2124426": "It'd be nice if folks posting solutions gave some credit to the rest of their teammates.  Perhaps mention some of their important contributions for folks who come later and want to evaluate them as a potential teammate.",
    "2124433": "Its a good idea. 😄 I'd like to say all my teammates are unique and irreplaceable. All of us work hard together to get such a high rank in this competition.",
    "2124459": "Supplement: original [SAS](https://cseweb.ucsd.edu/~jmcauley/pdfs/icdm18.pdf) without type(click,cart,and order), we add type like bert through type embedding and call it SAST.  Features of SAST mainly contain three parts:1. no type and no posistion embedding score; 2. type and no posistion embedding score. 3. type and posistion embedding score. In this competition, I learn a lot from my teammates in both coding and ideas. Thanks a lot!",
    "2124651": "Will you open source your code later? Want to learn the details of the plan",
    "2124655": "As you can see, the whole pipeline of our solution is complex. Probably I will only release my recall part (co-visitation based)."
  },
  "source": "meta"
}