{
  "id": 427002,
  "title": "Question about the high-scored public notebooks",
  "url": "/competitions/cafa-5-protein-function-prediction/discussion/427002",
  "author_name": "",
  "post_date": "2023-07-26T04:27:53.025681100Z",
  "votes": 4,
  "comment_count": 6,
  "views": 0,
  "content": "<p>In the <a href=\"https://www.kaggle.com/code/siddhvr/cafa5-using-protbert-embeds/notebook\" target=\"_blank\">high-scored public notebooks</a>, I have a question about the ensemble part. As we see in the code:<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3110858%2Fba1e1f3031c5d89c4fc745c02ab52d91%2FWX20230726-1212072x.png?generation=1690345078224152&amp;alt=media\" alt=\"\"><br>\nThe two results are merged with <code>how='outer'</code>. If there are differential GO terms from one to the other, the outcome will contain <code>nan</code>, and thus we can use this code to ensemble:</p>\n<pre><code>submissions = submissions(lambda row: row  not np(row)  row, axis=)\n</code></pre>\n<p>But the two submissions used for ensemble are all trained with <code>num_labels = 500</code>. That is, the GO terms in the two submissions are the same, and there wouldn't have <code>nan</code> in the merged output. Is it right?<br>\nWish to see your views.</p>",
  "messages": [
    {
      "id": "2359213",
      "postDate": "07/26/2023 04:27:53",
      "content": "<p>In the <a href=\"https://www.kaggle.com/code/siddhvr/cafa5-using-protbert-embeds/notebook\" target=\"_blank\">high-scored public notebooks</a>, I have a question about the ensemble part. As we see in the code:<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3110858%2Fba1e1f3031c5d89c4fc745c02ab52d91%2FWX20230726-1212072x.png?generation=1690345078224152&amp;alt=media\" alt=\"\"><br>\nThe two results are merged with <code>how='outer'</code>. If there are differential GO terms from one to the other, the outcome will contain <code>nan</code>, and thus we can use this code to ensemble:</p>\n<pre><code>submissions = submissions(lambda row: row  not np(row)  row, axis=)\n</code></pre>\n<p>But the two submissions used for ensemble are all trained with <code>num_labels = 500</code>. That is, the GO terms in the two submissions are the same, and there wouldn't have <code>nan</code> in the merged output. Is it right?<br>\nWish to see your views.</p>",
      "rawMarkdown": "In the [high-scored public notebooks](https://www.kaggle.com/code/siddhvr/cafa5-using-protbert-embeds/notebook), I have a question about the ensemble part. As we see in the code:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3110858%2Fba1e1f3031c5d89c4fc745c02ab52d91%2FWX20230726-1212072x.png?generation=1690345078224152&alt=media)\nThe two results are merged with `how='outer'`. If there are differential GO terms from one to the other, the outcome will contain `nan`, and thus we can use this code to ensemble:\n```\nsubmissions['confidence_combined'] = submissions.apply(lambda row: row['Confidence2'] if not np.isnan(row['Confidence2']) else row['Confidence'], axis=1)\n```\nBut the two submissions used for ensemble are all trained with `num_labels = 500`. That is, the GO terms in the two submissions are the same, and there wouldn't have `nan` in the merged output. Is it right?\nWish to see your views.",
      "votes": null
    },
    {
      "id": "2359243",
      "postDate": "07/26/2023 04:52:44",
      "content": "<p>I think that when it applies the lambda, it always prefers the value in submission2. Therefore, even if you are changing the hyperparameters or even the model, you will still get the same scores. </p>",
      "rawMarkdown": "I think that when it applies the lambda, it always prefers the value in submission2. Therefore, even if you are changing the hyperparameters or even the model, you will still get the same scores.",
      "votes": null
    },
    {
      "id": "2359255",
      "postDate": "07/26/2023 05:01:17",
      "content": "<p>Yes, I think there is no difference between the unseen <code>submission2</code> and the ensemble output.</p>",
      "rawMarkdown": "Yes, I think there is no difference between the unseen `submission2` and the ensemble output.",
      "votes": null
    },
    {
      "id": "2359722",
      "postDate": "07/26/2023 10:56:05",
      "content": "<p>some people use such tricks to earn upvotes on kaggle<br>\nThe notebook is doing  not what  we might expect from the first look.<br>\nBut since not many go into details - upvotes are obtained</p>",
      "rawMarkdown": "some people use such tricks to earn upvotes on kaggle\nThe notebook is doing  not what  we might expect from the first look.\nBut since not many go into details - upvotes are obtained",
      "votes": null
    },
    {
      "id": "2359733",
      "postDate": "07/26/2023 11:04:48",
      "content": "<p>Thanks for your explanation.</p>",
      "rawMarkdown": "Thanks for your explanation.",
      "votes": null
    },
    {
      "id": "2361278",
      "postDate": "07/27/2023 10:01:21",
      "content": "<p>Try <code>submissions.tail()</code>. There is a lot of \"headless\" Confidence 😅<br>\nAlthough it merge with <code>how='outer'</code>, the <code>submission_df</code> unique output is suppressed by <code>submissions.drop</code> 😅<br>\nI assumed once you add them back, the score will drop 😝</p>",
      "rawMarkdown": "Try `submissions.tail()`. There is a lot of \"headless\" Confidence 😅\nAlthough it merge with `how='outer'`, the `submission_df` unique output is suppressed by `submissions.drop` 😅\nI assumed once you add them back, the score will drop 😝",
      "votes": null
    },
    {
      "id": "2365124",
      "postDate": "07/30/2023 02:17:43",
      "content": "<p>Yes. I tried to directly submit the \"submission2\" and got the exact same result. lol</p>",
      "rawMarkdown": "Yes. I tried to directly submit the \"submission2\" and got the exact same result. lol",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2359243,
      "author_name": "jeremyxu677",
      "author_url": "",
      "post_date": "07/26/2023 04:52:44",
      "content": "<p>I think that when it applies the lambda, it always prefers the value in submission2. Therefore, even if you are changing the hyperparameters or even the model, you will still get the same scores. </p>",
      "votes": null,
      "replies": [
        {
          "id": 2359255,
          "author_name": "takanashihumbert",
          "author_url": "",
          "post_date": "07/26/2023 05:01:17",
          "content": "<p>Yes, I think there is no difference between the unseen <code>submission2</code> and the ensemble output.</p>",
          "votes": null,
          "replies": [
            {
              "id": 2359722,
              "author_name": "alexandervc",
              "author_url": "",
              "post_date": "07/26/2023 10:56:05",
              "content": "<p>some people use such tricks to earn upvotes on kaggle<br>\nThe notebook is doing  not what  we might expect from the first look.<br>\nBut since not many go into details - upvotes are obtained</p>",
              "votes": null,
              "replies": [
                {
                  "id": 2359733,
                  "author_name": "takanashihumbert",
                  "author_url": "",
                  "post_date": "07/26/2023 11:04:48",
                  "content": "<p>Thanks for your explanation.</p>",
                  "votes": null,
                  "replies": []
                }
              ]
            },
            {
              "id": 2365124,
              "author_name": "yixuansongeason",
              "author_url": "",
              "post_date": "07/30/2023 02:17:43",
              "content": "<p>Yes. I tried to directly submit the \"submission2\" and got the exact same result. lol</p>",
              "votes": null,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2361278,
      "author_name": "awater1223",
      "author_url": "",
      "post_date": "07/27/2023 10:01:21",
      "content": "<p>Try <code>submissions.tail()</code>. There is a lot of \"headless\" Confidence 😅<br>\nAlthough it merge with <code>how='outer'</code>, the <code>submission_df</code> unique output is suppressed by <code>submissions.drop</code> 😅<br>\nI assumed once you add them back, the score will drop 😝</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2359213": "In the [high-scored public notebooks](https://www.kaggle.com/code/siddhvr/cafa5-using-protbert-embeds/notebook), I have a question about the ensemble part. As we see in the code:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3110858%2Fba1e1f3031c5d89c4fc745c02ab52d91%2FWX20230726-1212072x.png?generation=1690345078224152&alt=media)\nThe two results are merged with `how='outer'`. If there are differential GO terms from one to the other, the outcome will contain `nan`, and thus we can use this code to ensemble:\n```\nsubmissions['confidence_combined'] = submissions.apply(lambda row: row['Confidence2'] if not np.isnan(row['Confidence2']) else row['Confidence'], axis=1)\n```\nBut the two submissions used for ensemble are all trained with `num_labels = 500`. That is, the GO terms in the two submissions are the same, and there wouldn't have `nan` in the merged output. Is it right?\nWish to see your views.",
    "2359243": "I think that when it applies the lambda, it always prefers the value in submission2. Therefore, even if you are changing the hyperparameters or even the model, you will still get the same scores.",
    "2359255": "Yes, I think there is no difference between the unseen `submission2` and the ensemble output.",
    "2359722": "some people use such tricks to earn upvotes on kaggle\nThe notebook is doing  not what  we might expect from the first look.\nBut since not many go into details - upvotes are obtained",
    "2359733": "Thanks for your explanation.",
    "2361278": "Try `submissions.tail()`. There is a lot of \"headless\" Confidence 😅\nAlthough it merge with `how='outer'`, the `submission_df` unique output is suppressed by `submissions.drop` 😅\nI assumed once you add them back, the score will drop 😝",
    "2365124": "Yes. I tried to directly submit the \"submission2\" and got the exact same result. lol"
  },
  "source": "meta"
}