{
  "id": 384598,
  "title": "Small step to session-based recommend system.",
  "url": "/competitions/otto-recommender-system/discussion/384598",
  "author_name": "Kim Jinha",
  "post_date": "2023-02-08T16:18:19.761000",
  "votes": 7,
  "comment_count": 0,
  "views": 0,
  "content": "<p>I am also one of the participants who learned a lot through this competition, and I am grateful to those who gave me great lessons through discussion and code.  I really like Kaggle's spirit of sharing and competition, but I can't believe there was cheating.  Unlike data scientists who always work hard, some people who take the easy but dark path will face a wall of regret someday, anywhere.  No pain! No gain!</p>\n<h1>Feature from someone's habit</h1>\n<p>Although it was a small step rather than a huge big step introduced by other good Kagglers, I would like to share one of features I tried in the ranking model.  I expected to be able to count patterns that can represent someone's habits, and tried to utilize the counted patterns as features.  It was assumed that the sequence of clicks, carts, and orders for the same article reveals personal habits.  The type is converted to <code>{click:0, cart:1, order:2}</code>, and patterns of <code>00,01,02,10,20</code> as shown in the figure below can appear in chronological order for the same article.  For example, <code>01</code> was thought to be the habit of a person who clicks and puts it in the cart immediately, and <code>02</code> is a habit of a person who clicks and places an order immediately.  Sometimes the sequence of <code>20</code> comes out, but I thought this was a habit of people who click to look at the article once more after ordering.  In some cases, patterns of <code>010,011,012,001</code> may appear, and in some cases, patterns of <code>0*0,0*1,0*2</code> may appear.  Here, * indicates the case of going through another article as shown in the figure below.  Among the 49 patterns found in this way, some patterns showed <code>feature importances</code> as much as the ratio of click/cart/order.  Due to lack of time, I have not been able to apply multiple combinations to the <code>ranking model</code>.  And I tried to sum up these specific patterns of sessions and express them as features of aids.  The patterns that appeared in several sessions would appear differently depending on the type of article, and I thought that the sum of them could be regarded as the features of the aid.  Its <code>feature importance</code> was comparable to the ratio of types. (Here is  <a href=\"https://www.kaggle.com/datasets/kimjinha/otto-features-about-someones-habit\" target=\"_blank\">dataset</a>.)</p>\n<blockquote>\n  <p>49 patterns : ['00', '01', '02', '10', '11', '12', '20', '21', '22'],<br>\n   ['000', '001', '002', '010', '011', '012', '020', '021', '022', '100', '101', '102', '110', '111', '112', '120', '121', '122', <br>\n  '200', '201', '202', '210', '211', '212', '220', '221',  '222'], ['0 * 0', '0 * 1', '0 * 2', '1 * 0', '1 * 1', '1 * 2', '2 * 0', '2 * 1', '2 * 2']</p>\n</blockquote>\n<h1>Small step this time! Big step next time?😄</h1>\n<p>The goal was to raise the score with the ranking model. Fortunately, I applied the ranking model only to orders, I raised the score with the ranking model on the last day of the competition. (Even this was applied in only 77% of sessions due to lack of time.) As a result, LB was able to increase by 0.00255 compared to the handcrafted model.  (LB 0.57658 -&gt; 0.57913) <code>50 candidates</code> were used, <code>100 features</code> were used for the model, and <code>lgbm</code> was utilized.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6957656%2F7488ecd2b84b387b3660d43ac05f14d0%2F0392D0C0-4956-442C-A331-F12375F2D401.jpeg?generation=1675869512439787&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": 2135411,
      "postDate": "2023-02-08T16:18:19.760Z",
      "content": "<p>I am also one of the participants who learned a lot through this competition, and I am grateful to those who gave me great lessons through discussion and code.  I really like Kaggle's spirit of sharing and competition, but I can't believe there was cheating.  Unlike data scientists who always work hard, some people who take the easy but dark path will face a wall of regret someday, anywhere.  No pain! No gain!</p>\n<h1>Feature from someone's habit</h1>\n<p>Although it was a small step rather than a huge big step introduced by other good Kagglers, I would like to share one of features I tried in the ranking model.  I expected to be able to count patterns that can represent someone's habits, and tried to utilize the counted patterns as features.  It was assumed that the sequence of clicks, carts, and orders for the same article reveals personal habits.  The type is converted to <code>{click:0, cart:1, order:2}</code>, and patterns of <code>00,01,02,10,20</code> as shown in the figure below can appear in chronological order for the same article.  For example, <code>01</code> was thought to be the habit of a person who clicks and puts it in the cart immediately, and <code>02</code> is a habit of a person who clicks and places an order immediately.  Sometimes the sequence of <code>20</code> comes out, but I thought this was a habit of people who click to look at the article once more after ordering.  In some cases, patterns of <code>010,011,012,001</code> may appear, and in some cases, patterns of <code>0*0,0*1,0*2</code> may appear.  Here, * indicates the case of going through another article as shown in the figure below.  Among the 49 patterns found in this way, some patterns showed <code>feature importances</code> as much as the ratio of click/cart/order.  Due to lack of time, I have not been able to apply multiple combinations to the <code>ranking model</code>.  And I tried to sum up these specific patterns of sessions and express them as features of aids.  The patterns that appeared in several sessions would appear differently depending on the type of article, and I thought that the sum of them could be regarded as the features of the aid.  Its <code>feature importance</code> was comparable to the ratio of types. (Here is  <a href=\"https://www.kaggle.com/datasets/kimjinha/otto-features-about-someones-habit\" target=\"_blank\">dataset</a>.)</p>\n<blockquote>\n  <p>49 patterns : ['00', '01', '02', '10', '11', '12', '20', '21', '22'],<br>\n   ['000', '001', '002', '010', '011', '012', '020', '021', '022', '100', '101', '102', '110', '111', '112', '120', '121', '122', <br>\n  '200', '201', '202', '210', '211', '212', '220', '221',  '222'], ['0 * 0', '0 * 1', '0 * 2', '1 * 0', '1 * 1', '1 * 2', '2 * 0', '2 * 1', '2 * 2']</p>\n</blockquote>\n<h1>Small step this time! Big step next time?😄</h1>\n<p>The goal was to raise the score with the ranking model. Fortunately, I applied the ranking model only to orders, I raised the score with the ranking model on the last day of the competition. (Even this was applied in only 77% of sessions due to lack of time.) As a result, LB was able to increase by 0.00255 compared to the handcrafted model.  (LB 0.57658 -&gt; 0.57913) <code>50 candidates</code> were used, <code>100 features</code> were used for the model, and <code>lgbm</code> was utilized.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6957656%2F7488ecd2b84b387b3660d43ac05f14d0%2F0392D0C0-4956-442C-A331-F12375F2D401.jpeg?generation=1675869512439787&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "I am also one of the participants who learned a lot through this competition, and I am grateful to those who gave me great lessons through discussion and code.  I really like Kaggle's spirit of sharing and competition, but I can't believe there was cheating.  Unlike data scientists who always work hard, some people who take the easy but dark path will face a wall of regret someday, anywhere.  No pain! No gain!\n\n# Feature from someone's habit\nAlthough it was a small step rather than a huge big step introduced by other good Kagglers, I would like to share one of features I tried in the ranking model.  I expected to be able to count patterns that can represent someone's habits, and tried to utilize the counted patterns as features.  It was assumed that the sequence of clicks, carts, and orders for the same article reveals personal habits.  The type is converted to `{click:0, cart:1, order:2}`, and patterns of `00,01,02,10,20` as shown in the figure below can appear in chronological order for the same article.  For example, `01` was thought to be the habit of a person who clicks and puts it in the cart immediately, and `02` is a habit of a person who clicks and places an order immediately.  Sometimes the sequence of `20` comes out, but I thought this was a habit of people who click to look at the article once more after ordering.  In some cases, patterns of `010,011,012,001` may appear, and in some cases, patterns of `0*0,0*1,0*2` may appear.  Here, * indicates the case of going through another article as shown in the figure below.  Among the 49 patterns found in this way, some patterns showed `feature importances` as much as the ratio of click/cart/order.  Due to lack of time, I have not been able to apply multiple combinations to the `ranking model`.  And I tried to sum up these specific patterns of sessions and express them as features of aids.  The patterns that appeared in several sessions would appear differently depending on the type of article, and I thought that the sum of them could be regarded as the features of the aid.  Its `feature importance` was comparable to the ratio of types. (Here is  [dataset][1].)\n>49 patterns : ['00', '01', '02', '10', '11', '12', '20', '21', '22'],\n ['000', '001', '002', '010', '011', '012', '020', '021', '022', '100', '101', '102', '110', '111', '112', '120', '121', '122', \n'200', '201', '202', '210', '211', '212', '220', '221',  '222'], ['0 * 0', '0 * 1', '0 * 2', '1 * 0', '1 * 1', '1 * 2', '2 * 0', '2 * 1', '2 * 2']\n\n# Small step this time! Big step next time?😄\nThe goal was to raise the score with the ranking model. Fortunately, I applied the ranking model only to orders, I raised the score with the ranking model on the last day of the competition. (Even this was applied in only 77% of sessions due to lack of time.) As a result, LB was able to increase by 0.00255 compared to the handcrafted model.  (LB 0.57658 -> 0.57913) `50 candidates` were used, `100 features` were used for the model, and `lgbm` was utilized.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6957656%2F7488ecd2b84b387b3660d43ac05f14d0%2F0392D0C0-4956-442C-A331-F12375F2D401.jpeg?generation=1675869512439787&alt=media)\n\n[1]: https://www.kaggle.com/datasets/kimjinha/otto-features-about-someones-habit",
      "votes": 7
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "2135411": "I am also one of the participants who learned a lot through this competition, and I am grateful to those who gave me great lessons through discussion and code.  I really like Kaggle's spirit of sharing and competition, but I can't believe there was cheating.  Unlike data scientists who always work hard, some people who take the easy but dark path will face a wall of regret someday, anywhere.  No pain! No gain!\n\n# Feature from someone's habit\nAlthough it was a small step rather than a huge big step introduced by other good Kagglers, I would like to share one of features I tried in the ranking model.  I expected to be able to count patterns that can represent someone's habits, and tried to utilize the counted patterns as features.  It was assumed that the sequence of clicks, carts, and orders for the same article reveals personal habits.  The type is converted to `{click:0, cart:1, order:2}`, and patterns of `00,01,02,10,20` as shown in the figure below can appear in chronological order for the same article.  For example, `01` was thought to be the habit of a person who clicks and puts it in the cart immediately, and `02` is a habit of a person who clicks and places an order immediately.  Sometimes the sequence of `20` comes out, but I thought this was a habit of people who click to look at the article once more after ordering.  In some cases, patterns of `010,011,012,001` may appear, and in some cases, patterns of `0*0,0*1,0*2` may appear.  Here, * indicates the case of going through another article as shown in the figure below.  Among the 49 patterns found in this way, some patterns showed `feature importances` as much as the ratio of click/cart/order.  Due to lack of time, I have not been able to apply multiple combinations to the `ranking model`.  And I tried to sum up these specific patterns of sessions and express them as features of aids.  The patterns that appeared in several sessions would appear differently depending on the type of article, and I thought that the sum of them could be regarded as the features of the aid.  Its `feature importance` was comparable to the ratio of types. (Here is  [dataset][1].)\n>49 patterns : ['00', '01', '02', '10', '11', '12', '20', '21', '22'],\n ['000', '001', '002', '010', '011', '012', '020', '021', '022', '100', '101', '102', '110', '111', '112', '120', '121', '122', \n'200', '201', '202', '210', '211', '212', '220', '221',  '222'], ['0 * 0', '0 * 1', '0 * 2', '1 * 0', '1 * 1', '1 * 2', '2 * 0', '2 * 1', '2 * 2']\n\n# Small step this time! Big step next time?😄\nThe goal was to raise the score with the ranking model. Fortunately, I applied the ranking model only to orders, I raised the score with the ranking model on the last day of the competition. (Even this was applied in only 77% of sessions due to lack of time.) As a result, LB was able to increase by 0.00255 compared to the handcrafted model.  (LB 0.57658 -> 0.57913) `50 candidates` were used, `100 features` were used for the model, and `lgbm` was utilized.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F6957656%2F7488ecd2b84b387b3660d43ac05f14d0%2F0392D0C0-4956-442C-A331-F12375F2D401.jpeg?generation=1675869512439787&alt=media)\n\n[1]: https://www.kaggle.com/datasets/kimjinha/otto-features-about-someones-habit"
  }
}