{
  "id": 308990,
  "title": "implementation of the evluation metric",
  "url": "/competitions/h-and-m-personalized-fashion-recommendations/discussion/308990",
  "author_name": "",
  "post_date": "2022-02-21T10:37:42.172992600Z",
  "votes": 3,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Could I please ask if this is the official implementation of the evaluation metric? The one that will be used to score the competition?</p>\n<p><a href=\"https://raw.githubusercontent.com/benhamner/Metrics/master/Python/ml_metrics/average_precision.py\" target=\"_blank\">link to Ben Hamner's repo</a></p>",
  "messages": [
    {
      "id": "1699650",
      "postDate": "02/21/2022 10:37:42",
      "content": "<p>Could I please ask if this is the official implementation of the evaluation metric? The one that will be used to score the competition?</p>\n<p><a href=\"https://raw.githubusercontent.com/benhamner/Metrics/master/Python/ml_metrics/average_precision.py\" target=\"_blank\">link to Ben Hamner's repo</a></p>",
      "rawMarkdown": "Could I please ask if this is the official implementation of the evaluation metric? The one that will be used to score the competition?\n\n[link to Ben Hamner's repo](https://raw.githubusercontent.com/benhamner/Metrics/master/Python/ml_metrics/average_precision.py)",
      "votes": null
    },
    {
      "id": "1699859",
      "postDate": "02/21/2022 13:43:37",
      "content": "<p>Yes it is. Kaggle themselves posted it <a href=\"https://www.kaggle.com/c/h-and-m-personalized-fashion-recommendations/discussion/306007#1680513\" target=\"_blank\">here</a>. And it is demonstrated in public notebook <a href=\"https://www.kaggle.com/kaerunantoka/h-m-how-to-calculate-map-12\" target=\"_blank\">here</a>. However note that public notebook uses it incorrectly i think. The function to compute metric does not remove the customers who made no purchases and does not rearrange the order of two dataframe ground truth and preds. So we need to (1) remove customers (2) order rows the same, ourselves before calling the function <code>mapk</code></p>",
      "rawMarkdown": "Yes it is. Kaggle themselves posted it [here][1]. And it is demonstrated in public notebook [here][2]. However note that public notebook uses it incorrectly i think. The function to compute metric does not remove the customers who made no purchases and does not rearrange the order of two dataframe ground truth and preds. So we need to (1) remove customers (2) order rows the same, ourselves before calling the function `mapk`\n\n[1]: https://www.kaggle.com/c/h-and-m-personalized-fashion-recommendations/discussion/306007#1680513\n[2]: https://www.kaggle.com/kaerunantoka/h-m-how-to-calculate-map-12",
      "votes": null
    },
    {
      "id": "1700269",
      "postDate": "02/21/2022 19:30:10",
      "content": "<p><a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a>  thank you very much for your answer, really appreciate it!!!!</p>",
      "rawMarkdown": "cdeotte  thank you very much for your answer, really appreciate it!!!!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1699859,
      "author_name": "cdeotte",
      "author_url": "",
      "post_date": "02/21/2022 13:43:37",
      "content": "<p>Yes it is. Kaggle themselves posted it <a href=\"https://www.kaggle.com/c/h-and-m-personalized-fashion-recommendations/discussion/306007#1680513\" target=\"_blank\">here</a>. And it is demonstrated in public notebook <a href=\"https://www.kaggle.com/kaerunantoka/h-m-how-to-calculate-map-12\" target=\"_blank\">here</a>. However note that public notebook uses it incorrectly i think. The function to compute metric does not remove the customers who made no purchases and does not rearrange the order of two dataframe ground truth and preds. So we need to (1) remove customers (2) order rows the same, ourselves before calling the function <code>mapk</code></p>",
      "votes": null,
      "replies": [
        {
          "id": 1700269,
          "author_name": "radek1",
          "author_url": "",
          "post_date": "02/21/2022 19:30:10",
          "content": "<p><a href=\"https://www.kaggle.com/cdeotte\" target=\"_blank\">@cdeotte</a>  thank you very much for your answer, really appreciate it!!!!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1699650": "Could I please ask if this is the official implementation of the evaluation metric? The one that will be used to score the competition?\n\n[link to Ben Hamner's repo](https://raw.githubusercontent.com/benhamner/Metrics/master/Python/ml_metrics/average_precision.py)",
    "1699859": "Yes it is. Kaggle themselves posted it [here][1]. And it is demonstrated in public notebook [here][2]. However note that public notebook uses it incorrectly i think. The function to compute metric does not remove the customers who made no purchases and does not rearrange the order of two dataframe ground truth and preds. So we need to (1) remove customers (2) order rows the same, ourselves before calling the function `mapk`\n\n[1]: https://www.kaggle.com/c/h-and-m-personalized-fashion-recommendations/discussion/306007#1680513\n[2]: https://www.kaggle.com/kaerunantoka/h-m-how-to-calculate-map-12",
    "1700269": "cdeotte  thank you very much for your answer, really appreciate it!!!!"
  },
  "source": "meta"
}