{
  "id": 308883,
  "title": "How to implement MAP5 for validating my models? ",
  "url": "/competitions/happy-whale-and-dolphin/discussion/308883",
  "author_name": "",
  "post_date": "2022-02-20T18:19:48.997975600Z",
  "votes": 8,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Has anyone implemented a function for scoring the MAP for this competition?</p>",
  "messages": [
    {
      "id": "1698870",
      "postDate": "02/20/2022 18:19:48",
      "content": "<p>Has anyone implemented a function for scoring the MAP for this competition?</p>",
      "rawMarkdown": "Has anyone implemented a function for scoring the MAP for this competition?",
      "votes": null
    },
    {
      "id": "1699037",
      "postDate": "02/20/2022 21:14:47",
      "content": "<p>There was an <a href=\"https://www.kaggle.com/pestipeti/explanation-of-map5-scoring-metric\" target=\"_blank\">amazing notebook with competition metric explanation</a> published by GM <a href=\"https://www.kaggle.com/pestipeti\" target=\"_blank\">@pestipeti</a></p>",
      "rawMarkdown": "There was an [amazing notebook with competition metric explanation](https://www.kaggle.com/pestipeti/explanation-of-map5-scoring-metric) published by GM @pestipeti",
      "votes": null
    },
    {
      "id": "1699769",
      "postDate": "02/21/2022 12:32:22",
      "content": "<p>The easiest implementation :)</p>\n<pre><code>def map5(gt,preds):\n  for i, pred in enumerate(preds):\n    if gt == pred:\n      return 1/(i+1)\n  return 0\n</code></pre>\n<pre><code>gt:  apple\npreds:  ['banana', 'apple', 'orange']\n0.5\n</code></pre>",
      "rawMarkdown": "The easiest implementation :)\n\n```\ndef map5(gt,preds):\n  for i, pred in enumerate(preds):\n    if gt == pred:\n      return 1/(i+1)\n  return 0\n```\n```\n\ngt:  apple\npreds:  ['banana', 'apple', 'orange']\n0.5\n```",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1699037,
      "author_name": "meowmeowmeowmeowmeow",
      "author_url": "",
      "post_date": "02/20/2022 21:14:47",
      "content": "<p>There was an <a href=\"https://www.kaggle.com/pestipeti/explanation-of-map5-scoring-metric\" target=\"_blank\">amazing notebook with competition metric explanation</a> published by GM <a href=\"https://www.kaggle.com/pestipeti\" target=\"_blank\">@pestipeti</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1699769,
      "author_name": "lukaszborecki",
      "author_url": "",
      "post_date": "02/21/2022 12:32:22",
      "content": "<p>The easiest implementation :)</p>\n<pre><code>def map5(gt,preds):\n  for i, pred in enumerate(preds):\n    if gt == pred:\n      return 1/(i+1)\n  return 0\n</code></pre>\n<pre><code>gt:  apple\npreds:  ['banana', 'apple', 'orange']\n0.5\n</code></pre>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1698870": "Has anyone implemented a function for scoring the MAP for this competition?",
    "1699037": "There was an [amazing notebook with competition metric explanation](https://www.kaggle.com/pestipeti/explanation-of-map5-scoring-metric) published by GM @pestipeti",
    "1699769": "The easiest implementation :)\n\n```\ndef map5(gt,preds):\n  for i, pred in enumerate(preds):\n    if gt == pred:\n      return 1/(i+1)\n  return 0\n```\n```\n\ngt:  apple\npreds:  ['banana', 'apple', 'orange']\n0.5\n```"
  },
  "source": "meta"
}