{
  "id": 307123,
  "title": "Will duplicated articles for same user benefit the submission?  No",
  "url": "/competitions/h-and-m-personalized-fashion-recommendations/discussion/307123",
  "author_name": "",
  "post_date": "2022-02-12T17:47:36.984387700Z",
  "votes": 6,
  "comment_count": 1,
  "views": 0,
  "content": "<p>I notice there are some duplicate article_ids for a user in this post <br>\n<a href=\"https://www.kaggle.com/gpreda/h-m-eda-and-prediction\" target=\"_blank\">https://www.kaggle.com/gpreda/h-m-eda-and-prediction</a></p>\n<p>so I did an experiment to check whether the duplicates will affect the submission or not</p>\n<p>first candidate: all the users with only one article_id as the prediction   </p>\n<pre><code>customer_id,prediction\n00000dbacae5abe5e23885899a1fa44253a17956c6d1c3d25f88aa139fdfc657,0924243001\n0000423b00ade91418cceaf3b26c6af3dd342b51fd051eec9c12fb36984420fa,0924243001\n000058a12d5b43e67d225668fa1f8d618c13dc232df0cad8ffe7ad4a1091e318,0924243001\n00005ca1c9ed5f5146b52ac8639a40ca9d57aeff4d1bd2c5feb1ca5dff07c43e,0924243001\n00006413d8573cd20ed7128e53b7b13819fe5cfc2d801fe7fc0f26dd8d65a85a,0924243001\n000064249685c11552da43ef22a5030f35a147f723d5b02ddd9fd22452b1f5a6,0924243001\n0000757967448a6cb83efb3ea7a3fb9d418ac7adf2379d8cd0c725276a467a2a,0924243001\n00007d2de826758b65a93dd24ce629ed66842531df6699338c5570910a014cc2,0924243001\n00007e8d4e54114b5b2a9b51586325a8d0fa74ea23ef77334eaec4ffccd7ebcc,0924243001\n</code></pre>\n<p>lead to public lb with 0.002 score</p>\n<p>second candidate: all the user with 12 same article_ids: 0924243001 * 12 <br>\ni.e.</p>\n<pre><code>customer_id,prediction\n00000dbacae5abe5e23885899a1fa44253a17956c6d1c3d25f88aa139fdfc657,0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001\n</code></pre>\n<p>which  public lb is still as 0.002 score</p>\n<p>if duplicated article_ids will be counted<br>\nthe score should be 0.002 * 12 <br>\nso my conclusion is that: remove duplicates!</p>",
  "messages": [
    {
      "id": "1687266",
      "postDate": "02/12/2022 17:47:36",
      "content": "<p>I notice there are some duplicate article_ids for a user in this post <br>\n<a href=\"https://www.kaggle.com/gpreda/h-m-eda-and-prediction\" target=\"_blank\">https://www.kaggle.com/gpreda/h-m-eda-and-prediction</a></p>\n<p>so I did an experiment to check whether the duplicates will affect the submission or not</p>\n<p>first candidate: all the users with only one article_id as the prediction   </p>\n<pre><code>customer_id,prediction\n00000dbacae5abe5e23885899a1fa44253a17956c6d1c3d25f88aa139fdfc657,0924243001\n0000423b00ade91418cceaf3b26c6af3dd342b51fd051eec9c12fb36984420fa,0924243001\n000058a12d5b43e67d225668fa1f8d618c13dc232df0cad8ffe7ad4a1091e318,0924243001\n00005ca1c9ed5f5146b52ac8639a40ca9d57aeff4d1bd2c5feb1ca5dff07c43e,0924243001\n00006413d8573cd20ed7128e53b7b13819fe5cfc2d801fe7fc0f26dd8d65a85a,0924243001\n000064249685c11552da43ef22a5030f35a147f723d5b02ddd9fd22452b1f5a6,0924243001\n0000757967448a6cb83efb3ea7a3fb9d418ac7adf2379d8cd0c725276a467a2a,0924243001\n00007d2de826758b65a93dd24ce629ed66842531df6699338c5570910a014cc2,0924243001\n00007e8d4e54114b5b2a9b51586325a8d0fa74ea23ef77334eaec4ffccd7ebcc,0924243001\n</code></pre>\n<p>lead to public lb with 0.002 score</p>\n<p>second candidate: all the user with 12 same article_ids: 0924243001 * 12 <br>\ni.e.</p>\n<pre><code>customer_id,prediction\n00000dbacae5abe5e23885899a1fa44253a17956c6d1c3d25f88aa139fdfc657,0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001\n</code></pre>\n<p>which  public lb is still as 0.002 score</p>\n<p>if duplicated article_ids will be counted<br>\nthe score should be 0.002 * 12 <br>\nso my conclusion is that: remove duplicates!</p>",
      "rawMarkdown": "I notice there are some duplicate article_ids for a user in this post \nhttps://www.kaggle.com/gpreda/h-m-eda-and-prediction\n\nso I did an experiment to check whether the duplicates will affect the submission or not\n\nfirst candidate: all the users with only one article_id as the prediction   \n```\ncustomer_id,prediction\n00000dbacae5abe5e23885899a1fa44253a17956c6d1c3d25f88aa139fdfc657,0924243001\n0000423b00ade91418cceaf3b26c6af3dd342b51fd051eec9c12fb36984420fa,0924243001\n000058a12d5b43e67d225668fa1f8d618c13dc232df0cad8ffe7ad4a1091e318,0924243001\n00005ca1c9ed5f5146b52ac8639a40ca9d57aeff4d1bd2c5feb1ca5dff07c43e,0924243001\n00006413d8573cd20ed7128e53b7b13819fe5cfc2d801fe7fc0f26dd8d65a85a,0924243001\n000064249685c11552da43ef22a5030f35a147f723d5b02ddd9fd22452b1f5a6,0924243001\n0000757967448a6cb83efb3ea7a3fb9d418ac7adf2379d8cd0c725276a467a2a,0924243001\n00007d2de826758b65a93dd24ce629ed66842531df6699338c5570910a014cc2,0924243001\n00007e8d4e54114b5b2a9b51586325a8d0fa74ea23ef77334eaec4ffccd7ebcc,0924243001\n```\nlead to public lb with 0.002 score\n\n\nsecond candidate: all the user with 12 same article_ids: 0924243001 * 12 \ni.e.\n```\ncustomer_id,prediction\n00000dbacae5abe5e23885899a1fa44253a17956c6d1c3d25f88aa139fdfc657,0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001\n```\n\nwhich  public lb is still as 0.002 score\n\nif duplicated article_ids will be counted\nthe score should be 0.002 * 12 \nso my conclusion is that: remove duplicates!",
      "votes": null
    },
    {
      "id": "1687607",
      "postDate": "02/13/2022 02:06:58",
      "content": "<p>Probably you're correct.<br>\nKaggle staff has referenced a scoring implementation in <a href=\"https://www.kaggle.com/c/h-and-m-personalized-fashion-recommendations/discussion/306007#1680513\" target=\"_blank\">https://www.kaggle.com/c/h-and-m-personalized-fashion-recommendations/discussion/306007#1680513</a></p>\n<pre><code>    for i,p in enumerate(predicted):\n        if p in actual and p not in predicted[:i]:\n            num_hits += 1.0\n            score += num_hits / (i+1.0)\n</code></pre>\n<p>Notice the <code>p not in predicted[:i]</code> part, which skips duplicate prediction.</p>\n<p>Would be interesting to know what is the public LB score if you predict 12 different items, but all customers are predicted using those same 12 items.</p>",
      "rawMarkdown": "Probably you're correct.\nKaggle staff has referenced a scoring implementation in https://www.kaggle.com/c/h-and-m-personalized-fashion-recommendations/discussion/306007#1680513\n\n```\n    for i,p in enumerate(predicted):\n        if p in actual and p not in predicted[:i]:\n            num_hits += 1.0\n            score += num_hits / (i+1.0)\n```\n\nNotice the `p not in predicted[:i]` part, which skips duplicate prediction.\n\nWould be interesting to know what is the public LB score if you predict 12 different items, but all customers are predicted using those same 12 items.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1687607,
      "author_name": "thariqnugrohotomo",
      "author_url": "",
      "post_date": "02/13/2022 02:06:58",
      "content": "<p>Probably you're correct.<br>\nKaggle staff has referenced a scoring implementation in <a href=\"https://www.kaggle.com/c/h-and-m-personalized-fashion-recommendations/discussion/306007#1680513\" target=\"_blank\">https://www.kaggle.com/c/h-and-m-personalized-fashion-recommendations/discussion/306007#1680513</a></p>\n<pre><code>    for i,p in enumerate(predicted):\n        if p in actual and p not in predicted[:i]:\n            num_hits += 1.0\n            score += num_hits / (i+1.0)\n</code></pre>\n<p>Notice the <code>p not in predicted[:i]</code> part, which skips duplicate prediction.</p>\n<p>Would be interesting to know what is the public LB score if you predict 12 different items, but all customers are predicted using those same 12 items.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1687266": "I notice there are some duplicate article_ids for a user in this post \nhttps://www.kaggle.com/gpreda/h-m-eda-and-prediction\n\nso I did an experiment to check whether the duplicates will affect the submission or not\n\nfirst candidate: all the users with only one article_id as the prediction   \n```\ncustomer_id,prediction\n00000dbacae5abe5e23885899a1fa44253a17956c6d1c3d25f88aa139fdfc657,0924243001\n0000423b00ade91418cceaf3b26c6af3dd342b51fd051eec9c12fb36984420fa,0924243001\n000058a12d5b43e67d225668fa1f8d618c13dc232df0cad8ffe7ad4a1091e318,0924243001\n00005ca1c9ed5f5146b52ac8639a40ca9d57aeff4d1bd2c5feb1ca5dff07c43e,0924243001\n00006413d8573cd20ed7128e53b7b13819fe5cfc2d801fe7fc0f26dd8d65a85a,0924243001\n000064249685c11552da43ef22a5030f35a147f723d5b02ddd9fd22452b1f5a6,0924243001\n0000757967448a6cb83efb3ea7a3fb9d418ac7adf2379d8cd0c725276a467a2a,0924243001\n00007d2de826758b65a93dd24ce629ed66842531df6699338c5570910a014cc2,0924243001\n00007e8d4e54114b5b2a9b51586325a8d0fa74ea23ef77334eaec4ffccd7ebcc,0924243001\n```\nlead to public lb with 0.002 score\n\n\nsecond candidate: all the user with 12 same article_ids: 0924243001 * 12 \ni.e.\n```\ncustomer_id,prediction\n00000dbacae5abe5e23885899a1fa44253a17956c6d1c3d25f88aa139fdfc657,0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001 0924243001\n```\n\nwhich  public lb is still as 0.002 score\n\nif duplicated article_ids will be counted\nthe score should be 0.002 * 12 \nso my conclusion is that: remove duplicates!",
    "1687607": "Probably you're correct.\nKaggle staff has referenced a scoring implementation in https://www.kaggle.com/c/h-and-m-personalized-fashion-recommendations/discussion/306007#1680513\n\n```\n    for i,p in enumerate(predicted):\n        if p in actual and p not in predicted[:i]:\n            num_hits += 1.0\n            score += num_hits / (i+1.0)\n```\n\nNotice the `p not in predicted[:i]` part, which skips duplicate prediction.\n\nWould be interesting to know what is the public LB score if you predict 12 different items, but all customers are predicted using those same 12 items."
  },
  "source": "meta"
}