{
  "id": 289772,
  "title": "Evaluation Question",
  "url": "/competitions/g-research-crypto-forecasting/discussion/289772",
  "author_name": "",
  "post_date": "2021-11-22T04:44:22.901522500Z",
  "votes": 7,
  "comment_count": 8,
  "views": 0,
  "content": "<p>Hello Kaggle,  I have been trying to replicate the evaluation metric for the competition. To understand how my model performs against the leaderboard (better CV calibration). Currently, I'm using RMSE and some implementation of the completion metric Weighted version of the Pearson Correlation Coefficient.</p>\n<blockquote>\n  <p>Submissions are evaluated on a weighted version of the Pearson correlation coefficient. You can find additional details in the 'Prediction Details and Evaluation' section of this tutorial notebook.</p>\n</blockquote>\n<p>`def m(x, w):<br>\n    \"\"\"Weighted Mean\"\"\"<br>\n    return np.sum(x * w) / np.sum(w)</p>\n<p>def cov(x, y, w):<br>\n    \"\"\"Weighted Covariance\"\"\"<br>\n    return np.sum(w * (x - m(x, w)) * (y - m(y, w))) / np.sum(w)</p>\n<p>def corr(x, y, w):<br>\n    \"\"\"Weighted Correlation\"\"\"<br>\n    return cov(x, y, w) / np.sqrt(cov(x, x, w) * cov(y, y, w))`</p>\n<p>The issue is that my model Score locally: 0.001606 (Using the function described), but in the leaderboard, I'm getting: 0.0179</p>\n<p>Any recommendation to build a model metric that resembles the values of the LB closely<br>\nThanks</p>",
  "messages": [
    {
      "id": "1591197",
      "postDate": "11/22/2021 04:44:22",
      "content": "<p>Hello Kaggle,  I have been trying to replicate the evaluation metric for the competition. To understand how my model performs against the leaderboard (better CV calibration). Currently, I'm using RMSE and some implementation of the completion metric Weighted version of the Pearson Correlation Coefficient.</p>\n<blockquote>\n  <p>Submissions are evaluated on a weighted version of the Pearson correlation coefficient. You can find additional details in the 'Prediction Details and Evaluation' section of this tutorial notebook.</p>\n</blockquote>\n<p>`def m(x, w):<br>\n    \"\"\"Weighted Mean\"\"\"<br>\n    return np.sum(x * w) / np.sum(w)</p>\n<p>def cov(x, y, w):<br>\n    \"\"\"Weighted Covariance\"\"\"<br>\n    return np.sum(w * (x - m(x, w)) * (y - m(y, w))) / np.sum(w)</p>\n<p>def corr(x, y, w):<br>\n    \"\"\"Weighted Correlation\"\"\"<br>\n    return cov(x, y, w) / np.sqrt(cov(x, x, w) * cov(y, y, w))`</p>\n<p>The issue is that my model Score locally: 0.001606 (Using the function described), but in the leaderboard, I'm getting: 0.0179</p>\n<p>Any recommendation to build a model metric that resembles the values of the LB closely<br>\nThanks</p>",
      "rawMarkdown": "Hello Kaggle,  I have been trying to replicate the evaluation metric for the competition. To understand how my model performs against the leaderboard (better CV calibration). Currently, I'm using RMSE and some implementation of the completion metric Weighted version of the Pearson Correlation Coefficient.\n\n> Submissions are evaluated on a weighted version of the Pearson correlation coefficient. You can find additional details in the 'Prediction Details and Evaluation' section of this tutorial notebook.\n\n`def m(x, w):\n    \"\"\"Weighted Mean\"\"\"\n    return np.sum(x * w) / np.sum(w)\n\ndef cov(x, y, w):\n    \"\"\"Weighted Covariance\"\"\"\n    return np.sum(w * (x - m(x, w)) * (y - m(y, w))) / np.sum(w)\n\ndef corr(x, y, w):\n    \"\"\"Weighted Correlation\"\"\"\n    return cov(x, y, w) / np.sqrt(cov(x, x, w) * cov(y, y, w))`\n\nThe issue is that my model Score locally: 0.001606 (Using the function described), but in the leaderboard, I'm getting: 0.0179\n\nAny recommendation to build a model metric that resembles the values of the LB closely\nThanks",
      "votes": null
    },
    {
      "id": "1591422",
      "postDate": "11/22/2021 10:30:05",
      "content": "<p>I'm doing some testing and I think is just the weighted average of Pearson correlations calculated separately. Also, you have to be sure you are not using test labels to train.</p>\n<p>Don't bother I found the answer, thanks <a href=\"https://www.kaggle.com/yamqwe\" target=\"_blank\">@yamqwe</a>.</p>\n<p><a href=\"https://www.kaggle.com/yamqwe/what-if-we-just-submit-the-target-median\" target=\"_blank\">Look here</a></p>",
      "rawMarkdown": "I'm doing some testing and I think is just the weighted average of Pearson correlations calculated separately. Also, you have to be sure you are not using test labels to train.\n\nDon't bother I found the answer, thanks @yamqwe.\n\n[Look here](https://www.kaggle.com/yamqwe/what-if-we-just-submit-the-target-median)",
      "votes": null
    },
    {
      "id": "1591932",
      "postDate": "11/22/2021 18:00:29",
      "content": "<p>That is not that bad, my suggestion is consider using it and move on with other experiments :)</p>",
      "rawMarkdown": "That is not that bad, my suggestion is consider using it and move on with other experiments :)",
      "votes": null
    },
    {
      "id": "1592087",
      "postDate": "11/22/2021 21:54:05",
      "content": "<p>Asked the question in the official thread. No response so far.</p>",
      "rawMarkdown": "Asked the question in the official thread. No response so far.",
      "votes": null
    },
    {
      "id": "1592272",
      "postDate": "11/23/2021 02:39:15",
      "content": "<p>Thanks, <a href=\"https://www.kaggle.com/lucasmorin\" target=\"_blank\">@lucasmorin</a> do you have the link to the official thread so I can follow for updates.</p>",
      "rawMarkdown": "Thanks, @lucasmorin do you have the link to the official thread so I can follow for updates.",
      "votes": null
    },
    {
      "id": "1592274",
      "postDate": "11/23/2021 02:41:26",
      "content": "<p>Thanks, <a href=\"https://www.kaggle.com/agenlu\" target=\"_blank\">@agenlu</a> yes I'm only training on the strict dataset before 2021-06-13 00:00:00.</p>",
      "rawMarkdown": "Thanks, @agenlu yes I'm only training on the strict dataset before 2021-06-13 00:00:00.",
      "votes": null
    },
    {
      "id": "1597088",
      "postDate": "11/27/2021 07:43:46",
      "content": "<p>see my notebook <a href=\"https://www.kaggle.com/yamqwe/what-if-we-just-submit-the-target-median\" target=\"_blank\">What if we just submit the target median? 🤔</a>.<br>\nIt simulates the leaderboard nearly perfectly</p>",
      "rawMarkdown": "see my notebook [What if we just submit the target median? 🤔](https://www.kaggle.com/yamqwe/what-if-we-just-submit-the-target-median).\nIt simulates the leaderboard nearly perfectly",
      "votes": null
    },
    {
      "id": "1605136",
      "postDate": "12/04/2021 01:56:32",
      "content": "<p>Thanks, <a href=\"https://www.kaggle.com/yamqwe\" target=\"_blank\">@yamqwe</a> reviewing it right now to see how I can apply some of the strategies to it</p>",
      "rawMarkdown": "Thanks, @yamqwe reviewing it right now to see how I can apply some of the strategies to it",
      "votes": null
    },
    {
      "id": "1605547",
      "postDate": "12/04/2021 10:54:29",
      "content": "<p>I already said it in the comment section</p>",
      "rawMarkdown": "I already said it in the comment section",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1591422,
      "author_name": "agenlu",
      "author_url": "",
      "post_date": "11/22/2021 10:30:05",
      "content": "<p>I'm doing some testing and I think is just the weighted average of Pearson correlations calculated separately. Also, you have to be sure you are not using test labels to train.</p>\n<p>Don't bother I found the answer, thanks <a href=\"https://www.kaggle.com/yamqwe\" target=\"_blank\">@yamqwe</a>.</p>\n<p><a href=\"https://www.kaggle.com/yamqwe/what-if-we-just-submit-the-target-median\" target=\"_blank\">Look here</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 1592274,
          "author_name": "cv13j0",
          "author_url": "",
          "post_date": "11/23/2021 02:41:26",
          "content": "<p>Thanks, <a href=\"https://www.kaggle.com/agenlu\" target=\"_blank\">@agenlu</a> yes I'm only training on the strict dataset before 2021-06-13 00:00:00.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1591932,
      "author_name": "avivlevi815",
      "author_url": "",
      "post_date": "11/22/2021 18:00:29",
      "content": "<p>That is not that bad, my suggestion is consider using it and move on with other experiments :)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1592087,
      "author_name": "lucasmorin",
      "author_url": "",
      "post_date": "11/22/2021 21:54:05",
      "content": "<p>Asked the question in the official thread. No response so far.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1592272,
          "author_name": "cv13j0",
          "author_url": "",
          "post_date": "11/23/2021 02:39:15",
          "content": "<p>Thanks, <a href=\"https://www.kaggle.com/lucasmorin\" target=\"_blank\">@lucasmorin</a> do you have the link to the official thread so I can follow for updates.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1597088,
      "author_name": "",
      "author_url": "",
      "post_date": "11/27/2021 07:43:46",
      "content": "<p>see my notebook <a href=\"https://www.kaggle.com/yamqwe/what-if-we-just-submit-the-target-median\" target=\"_blank\">What if we just submit the target median? 🤔</a>.<br>\nIt simulates the leaderboard nearly perfectly</p>",
      "votes": null,
      "replies": [
        {
          "id": 1605136,
          "author_name": "cv13j0",
          "author_url": "",
          "post_date": "12/04/2021 01:56:32",
          "content": "<p>Thanks, <a href=\"https://www.kaggle.com/yamqwe\" target=\"_blank\">@yamqwe</a> reviewing it right now to see how I can apply some of the strategies to it</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1605547,
      "author_name": "swaralipibose",
      "author_url": "",
      "post_date": "12/04/2021 10:54:29",
      "content": "<p>I already said it in the comment section</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1591197": "Hello Kaggle,  I have been trying to replicate the evaluation metric for the competition. To understand how my model performs against the leaderboard (better CV calibration). Currently, I'm using RMSE and some implementation of the completion metric Weighted version of the Pearson Correlation Coefficient.\n\n> Submissions are evaluated on a weighted version of the Pearson correlation coefficient. You can find additional details in the 'Prediction Details and Evaluation' section of this tutorial notebook.\n\n`def m(x, w):\n    \"\"\"Weighted Mean\"\"\"\n    return np.sum(x * w) / np.sum(w)\n\ndef cov(x, y, w):\n    \"\"\"Weighted Covariance\"\"\"\n    return np.sum(w * (x - m(x, w)) * (y - m(y, w))) / np.sum(w)\n\ndef corr(x, y, w):\n    \"\"\"Weighted Correlation\"\"\"\n    return cov(x, y, w) / np.sqrt(cov(x, x, w) * cov(y, y, w))`\n\nThe issue is that my model Score locally: 0.001606 (Using the function described), but in the leaderboard, I'm getting: 0.0179\n\nAny recommendation to build a model metric that resembles the values of the LB closely\nThanks",
    "1591422": "I'm doing some testing and I think is just the weighted average of Pearson correlations calculated separately. Also, you have to be sure you are not using test labels to train.\n\nDon't bother I found the answer, thanks @yamqwe.\n\n[Look here](https://www.kaggle.com/yamqwe/what-if-we-just-submit-the-target-median)",
    "1591932": "That is not that bad, my suggestion is consider using it and move on with other experiments :)",
    "1592087": "Asked the question in the official thread. No response so far.",
    "1592272": "Thanks, @lucasmorin do you have the link to the official thread so I can follow for updates.",
    "1592274": "Thanks, @agenlu yes I'm only training on the strict dataset before 2021-06-13 00:00:00.",
    "1597088": "see my notebook [What if we just submit the target median? 🤔](https://www.kaggle.com/yamqwe/what-if-we-just-submit-the-target-median).\nIt simulates the leaderboard nearly perfectly",
    "1605136": "Thanks, @yamqwe reviewing it right now to see how I can apply some of the strategies to it",
    "1605547": "I already said it in the comment section"
  },
  "source": "meta"
}