{
  "id": 129914,
  "title": "12th place post-processing",
  "content": "<p>```\nraters = np.array([18, 18,  6,  6,  6,  6, 18, 18,  6,  6,  6,  6,  6,  6,  6,  6,  6, 6,  6,  3, 18, 18, 18, 18, 18, 90,  6,  6,  6, 18])</p>\n\n<p>mins = np.min(all_preds,axis=0)\nmaxs = np.max(all_preds,axis=0)\nall_preds = (all_preds - mins)/(maxs - mins)</p>\n\n<p>all_preds =  np.round(raters*all_preds).astype(np.float)/raters</p>\n\n<p>```\nIf you have time please try this on your submission, I'm really interested to know how much it can boost your own score.</p>",
  "comments": [
    {
      "id": 742748,
      "author_name": "CPMP",
      "author_url": "",
      "post_date": "2020-02-11T14:21:31.547000",
      "content": "<p>HI, 4th team sued something similar.  I'll try.</p>\n\n<p>I'm sure you have additional interesting thins to share, your solo gold performance is worth sharing.  Congrats on solo gold!</p>",
      "votes": 1,
      "replies": [
        {
          "id": 742820,
          "author_name": "Khoi Nguyen",
          "author_url": "",
          "post_date": "2020-02-11T15:02:30.087000",
          "content": "<p>I checked your team's solution and our modeling part is very similar with double headed transformers. The thing that demotivated me from posting more of my solution though, is that I don't think my models really do better than anyone else in the top 30 or even 50, it all came down to who had a more robust post-processing method. That and I desperately need to take a nap now.</p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 742673,
      "author_name": "Marco Gorelli",
      "author_url": "",
      "post_date": "2020-02-11T13:21:06.507000",
      "content": "<p>Nice!</p>\n\n<p>Just one comment, I think the <code>90</code> should be <code>30</code></p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 742670,
      "author_name": "Chris Deotte",
      "author_url": "",
      "post_date": "2020-02-11T13:19:01.583000",
      "content": "<p>Congratulations Khoi. Awesome solo Gold finish!</p>\n\n<p>Khoi, you should try only applying your post process on the following predictions, I think it will perform 0.003 better:</p>\n\n<pre><code>['question_conversational',\n'question_type_compare',\n'question_type_consequence',\n'question_type_definition',\n'question_type_entity']\n</code></pre>\n\n<p>For comparison, here is my post process, I use <code>numpy.clip( preds, clippings[col][0], clippings[col][1] )</code> on the following targets:</p>\n\n<pre><code>clippings = {\n'question_has_commonly_accepted_answer':[0,0.6],\n'question_conversational':[0.15,1],\n'question_multi_intent':[0.1,1],\n'question_type_choice':[0.1,1],\n'question_type_compare':[0.1,1],\n'question_type_consequence':[0.08,1],\n'question_type_definition':[0.1,1],\n'question_type_entity':[0.13,1]\n}\n</code></pre>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 742569,
      "author_name": "RB",
      "author_url": "",
      "post_date": "2020-02-11T11:37:29.560000",
      "content": "<p>Congratulations and Thank you for posting this - </p>\n\n<p>I tried your code - </p>\n\n<p>|   | Private  | Public |\n| --- | --- |--- |\n|  My original No post procesing  | 0.37647  | 0.40449 |\n|  With my post processing (from public kernel)   | 0.40760   |  0.44128  |\n|  <strong>With your post processing</strong>   | 0.40230    |  0.43409 |</p>",
      "votes": 0,
      "replies": [
        {
          "id": 742571,
          "author_name": "Khoi Nguyen",
          "author_url": "",
          "post_date": "2020-02-11T11:38:56.470000",
          "content": "<p>So it was nowhere optimal!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 742404,
      "author_name": "oohara",
      "author_url": "",
      "post_date": "2020-02-11T09:27:56.160000",
      "content": "<p>Could you explain more about these two lines?\n<code>\nall_preds = (all_preds - mins)/(maxs - mins)\nall_preds =  np.round(raters*all_preds).astype(np.float)/raters\n</code></p>",
      "votes": 0,
      "replies": [
        {
          "id": 742406,
          "author_name": "Khoi Nguyen",
          "author_url": "",
          "post_date": "2020-02-11T09:29:24.703000",
          "content": "<p>Scaling to [0,1] range then rounding to match the training target distribution (it's discrete).</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 742647,
          "author_name": "Gerwyn",
          "author_url": "",
          "post_date": "2020-02-11T12:46:39.557000",
          "content": "<p><a href=\"/suicaokhoailang\">@suicaokhoailang</a> i'm guessing post-processing tricks are somewhat related closely to your model's output and thus, no \"one-size-fit-all\" approach? Anyways, may i ask what's the logic for the array of raters? can't wrap my head around it</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 742376,
      "author_name": "sinchir0",
      "author_url": "",
      "post_date": "2020-02-11T09:12:50.747000",
      "content": "<p>Thank you for sharing! I will try your post-processing after refreashing my GPU quota :)</p>\n\n<p>Could you tell me how you estimated the number of raters?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 742382,
          "author_name": "Khoi Nguyen",
          "author_url": "",
          "post_date": "2020-02-11T09:14:34.673000",
          "content": "<p>Find the smallest integer that when multiplied with all the unique values in a column you get all integers back.</p>",
          "votes": 3,
          "replies": []
        },
        {
          "id": 742398,
          "author_name": "Aditya Soni",
          "author_url": "",
          "post_date": "2020-02-11T09:24:58.183000",
          "content": "<p>LCM you meant, right?\nCongratulations on that Amazing Solo Gold 🙏 </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 742401,
          "author_name": "sinchir0",
          "author_url": "",
          "post_date": "2020-02-11T09:26:55.357000",
          "content": "<p>Thank you for reply. I understand. I wanted to notice in the competition.\nCongratulations on the 12th place !</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 742403,
          "author_name": "Khoi Nguyen",
          "author_url": "",
          "post_date": "2020-02-11T09:27:51.060000",
          "content": "<p><a href=\"/adityaecdrid\">@adityaecdrid</a> Kind of, but I don't know if it can be called LCM since LCM is defined for integers. My mathematical English is quite lacking anyway.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 742370,
      "author_name": "Theo Viel",
      "author_url": "",
      "post_date": "2020-02-11T09:08:46.370000",
      "content": "<p>I like your approach, it requires no parameter tunning and that's always good.\nHow much did you benefit from it ?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 742378,
          "author_name": "Khoi Nguyen",
          "author_url": "",
          "post_date": "2020-02-11T09:13:17.377000",
          "content": "<p>I used both this and the regular threshold trick, both boosted the public score (I guess that's why I was in the 0.48 zone). Since I got a shakedown I'm trying investigate whether this or the thresholds was the culprit however my late submissions crashed for no reasons. \nI'm guessing that the thresholds were the ones that lowered my score since this one requires no tuning as you said.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 742383,
          "author_name": "Theo Viel",
          "author_url": "",
          "post_date": "2020-02-11T09:15:36.683000",
          "content": "<p>Congratz anyways, really impressive solo run</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "comment_count": 17,
  "messages": [
    {
      "id": 742365,
      "postDate": "2020-02-11T09:02:22.420Z",
      "content": "<p>```\nraters = np.array([18, 18,  6,  6,  6,  6, 18, 18,  6,  6,  6,  6,  6,  6,  6,  6,  6, 6,  6,  3, 18, 18, 18, 18, 18, 90,  6,  6,  6, 18])</p>\n\n<p>mins = np.min(all_preds,axis=0)\nmaxs = np.max(all_preds,axis=0)\nall_preds = (all_preds - mins)/(maxs - mins)</p>\n\n<p>all_preds =  np.round(raters*all_preds).astype(np.float)/raters</p>\n\n<p>```\nIf you have time please try this on your submission, I'm really interested to know how much it can boost your own score.</p>",
      "rawMarkdown": "```\nraters = np.array([18, 18,  6,  6,  6,  6, 18, 18,  6,  6,  6,  6,  6,  6,  6,  6,  6, 6,  6,  3, 18, 18, 18, 18, 18, 90,  6,  6,  6, 18])\n\nmins = np.min(all_preds,axis=0)\nmaxs = np.max(all_preds,axis=0)\nall_preds = (all_preds - mins)/(maxs - mins)\n\nall_preds =  np.round(raters*all_preds).astype(np.float)/raters\n\n```\nIf you have time please try this on your submission, I'm really interested to know how much it can boost your own score.",
      "votes": 25
    },
    {
      "id": 742748,
      "postDate": "2020-02-11T14:21:31.547Z",
      "content": "<p>HI, 4th team sued something similar.  I'll try.</p>\n\n<p>I'm sure you have additional interesting thins to share, your solo gold performance is worth sharing.  Congrats on solo gold!</p>",
      "rawMarkdown": "HI, 4th team sued something similar.  I'll try.\n\nI'm sure you have additional interesting thins to share, your solo gold performance is worth sharing.  Congrats on solo gold!",
      "votes": 1,
      "replies": [
        {
          "id": 742820,
          "postDate": "2020-02-11T15:02:30.087Z",
          "content": "<p>I checked your team's solution and our modeling part is very similar with double headed transformers. The thing that demotivated me from posting more of my solution though, is that I don't think my models really do better than anyone else in the top 30 or even 50, it all came down to who had a more robust post-processing method. That and I desperately need to take a nap now.</p>",
          "rawMarkdown": "I checked your team's solution and our modeling part is very similar with double headed transformers. The thing that demotivated me from posting more of my solution though, is that I don't think my models really do better than anyone else in the top 30 or even 50, it all came down to who had a more robust post-processing method. That and I desperately need to take a nap now.",
          "votes": 2
        }
      ]
    },
    {
      "id": 742673,
      "postDate": "2020-02-11T13:21:06.507Z",
      "content": "<p>Nice!</p>\n\n<p>Just one comment, I think the <code>90</code> should be <code>30</code></p>",
      "rawMarkdown": "Nice!\n\nJust one comment, I think the `90` should be `30`"
    },
    {
      "id": 742670,
      "postDate": "2020-02-11T13:19:01.583Z",
      "content": "<p>Congratulations Khoi. Awesome solo Gold finish!</p>\n\n<p>Khoi, you should try only applying your post process on the following predictions, I think it will perform 0.003 better:</p>\n\n<pre><code>['question_conversational',\n'question_type_compare',\n'question_type_consequence',\n'question_type_definition',\n'question_type_entity']\n</code></pre>\n\n<p>For comparison, here is my post process, I use <code>numpy.clip( preds, clippings[col][0], clippings[col][1] )</code> on the following targets:</p>\n\n<pre><code>clippings = {\n'question_has_commonly_accepted_answer':[0,0.6],\n'question_conversational':[0.15,1],\n'question_multi_intent':[0.1,1],\n'question_type_choice':[0.1,1],\n'question_type_compare':[0.1,1],\n'question_type_consequence':[0.08,1],\n'question_type_definition':[0.1,1],\n'question_type_entity':[0.13,1]\n}\n</code></pre>",
      "rawMarkdown": "Congratulations Khoi. Awesome solo Gold finish!\n\nKhoi, you should try only applying your post process on the following predictions, I think it will perform 0.003 better:\n\n    ['question_conversational',\n    'question_type_compare',\n    'question_type_consequence',\n    'question_type_definition',\n    'question_type_entity']\n\nFor comparison, here is my post process, I use `numpy.clip( preds, clippings[col][0], clippings[col][1] )` on the following targets:\n\n    clippings = {\n    'question_has_commonly_accepted_answer':[0,0.6],\n    'question_conversational':[0.15,1],\n    'question_multi_intent':[0.1,1],\n    'question_type_choice':[0.1,1],\n    'question_type_compare':[0.1,1],\n    'question_type_consequence':[0.08,1],\n    'question_type_definition':[0.1,1],\n    'question_type_entity':[0.13,1]\n    }"
    },
    {
      "id": 742569,
      "postDate": "2020-02-11T11:37:29.560Z",
      "content": "<p>Congratulations and Thank you for posting this - </p>\n\n<p>I tried your code - </p>\n\n<p>|   | Private  | Public |\n| --- | --- |--- |\n|  My original No post procesing  | 0.37647  | 0.40449 |\n|  With my post processing (from public kernel)   | 0.40760   |  0.44128  |\n|  <strong>With your post processing</strong>   | 0.40230    |  0.43409 |</p>",
      "rawMarkdown": "Congratulations and Thank you for posting this - \n\nI tried your code - \n\n\n|   | Private  | Public |\n| --- | --- |--- |\n|  My original No post procesing  | 0.37647  | 0.40449 |\n|  With my post processing (from public kernel)   | 0.40760   |  0.44128  |\n|  **With your post processing**   | 0.40230    |  0.43409 |\n \n\n ",
      "replies": [
        {
          "id": 742571,
          "postDate": "2020-02-11T11:38:56.470Z",
          "content": "<p>So it was nowhere optimal!</p>",
          "rawMarkdown": "So it was nowhere optimal!"
        }
      ]
    },
    {
      "id": 742404,
      "postDate": "2020-02-11T09:27:56.160Z",
      "content": "<p>Could you explain more about these two lines?\n<code>\nall_preds = (all_preds - mins)/(maxs - mins)\nall_preds =  np.round(raters*all_preds).astype(np.float)/raters\n</code></p>",
      "rawMarkdown": "Could you explain more about these two lines?\n```\nall_preds = (all_preds - mins)/(maxs - mins)\nall_preds =  np.round(raters*all_preds).astype(np.float)/raters\n```",
      "replies": [
        {
          "id": 742406,
          "postDate": "2020-02-11T09:29:24.703Z",
          "content": "<p>Scaling to [0,1] range then rounding to match the training target distribution (it's discrete).</p>",
          "rawMarkdown": "Scaling to [0,1] range then rounding to match the training target distribution (it's discrete).",
          "votes": 1
        },
        {
          "id": 742647,
          "postDate": "2020-02-11T12:46:39.557Z",
          "content": "<p><a href=\"/suicaokhoailang\">@suicaokhoailang</a> i'm guessing post-processing tricks are somewhat related closely to your model's output and thus, no \"one-size-fit-all\" approach? Anyways, may i ask what's the logic for the array of raters? can't wrap my head around it</p>",
          "rawMarkdown": "@suicaokhoailang i'm guessing post-processing tricks are somewhat related closely to your model's output and thus, no \"one-size-fit-all\" approach? Anyways, may i ask what's the logic for the array of raters? can't wrap my head around it",
          "votes": 1
        }
      ]
    },
    {
      "id": 742376,
      "postDate": "2020-02-11T09:12:50.747Z",
      "content": "<p>Thank you for sharing! I will try your post-processing after refreashing my GPU quota :)</p>\n\n<p>Could you tell me how you estimated the number of raters?</p>",
      "rawMarkdown": "Thank you for sharing! I will try your post-processing after refreashing my GPU quota :)\n\nCould you tell me how you estimated the number of raters?",
      "replies": [
        {
          "id": 742382,
          "postDate": "2020-02-11T09:14:34.673Z",
          "content": "<p>Find the smallest integer that when multiplied with all the unique values in a column you get all integers back.</p>",
          "rawMarkdown": "Find the smallest integer that when multiplied with all the unique values in a column you get all integers back.",
          "votes": 3
        },
        {
          "id": 742398,
          "postDate": "2020-02-11T09:24:58.183Z",
          "content": "<p>LCM you meant, right?\nCongratulations on that Amazing Solo Gold 🙏 </p>",
          "rawMarkdown": "LCM you meant, right?\nCongratulations on that Amazing Solo Gold 🙏 "
        },
        {
          "id": 742401,
          "postDate": "2020-02-11T09:26:55.357Z",
          "content": "<p>Thank you for reply. I understand. I wanted to notice in the competition.\nCongratulations on the 12th place !</p>",
          "rawMarkdown": "Thank you for reply. I understand. I wanted to notice in the competition.\nCongratulations on the 12th place !"
        },
        {
          "id": 742403,
          "postDate": "2020-02-11T09:27:51.060Z",
          "content": "<p><a href=\"/adityaecdrid\">@adityaecdrid</a> Kind of, but I don't know if it can be called LCM since LCM is defined for integers. My mathematical English is quite lacking anyway.</p>",
          "rawMarkdown": "@adityaecdrid Kind of, but I don't know if it can be called LCM since LCM is defined for integers. My mathematical English is quite lacking anyway.",
          "votes": 1
        }
      ]
    },
    {
      "id": 742370,
      "postDate": "2020-02-11T09:08:46.370Z",
      "content": "<p>I like your approach, it requires no parameter tunning and that's always good.\nHow much did you benefit from it ?</p>",
      "rawMarkdown": "I like your approach, it requires no parameter tunning and that's always good.\nHow much did you benefit from it ?",
      "replies": [
        {
          "id": 742378,
          "postDate": "2020-02-11T09:13:17.377Z",
          "content": "<p>I used both this and the regular threshold trick, both boosted the public score (I guess that's why I was in the 0.48 zone). Since I got a shakedown I'm trying investigate whether this or the thresholds was the culprit however my late submissions crashed for no reasons. \nI'm guessing that the thresholds were the ones that lowered my score since this one requires no tuning as you said.</p>",
          "rawMarkdown": "I used both this and the regular threshold trick, both boosted the public score (I guess that's why I was in the 0.48 zone). Since I got a shakedown I'm trying investigate whether this or the thresholds was the culprit however my late submissions crashed for no reasons. \nI'm guessing that the thresholds were the ones that lowered my score since this one requires no tuning as you said."
        },
        {
          "id": 742383,
          "postDate": "2020-02-11T09:15:36.683Z",
          "content": "<p>Congratz anyways, really impressive solo run</p>",
          "rawMarkdown": "Congratz anyways, really impressive solo run"
        }
      ]
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T19:08:00Z",
  "competition_id": 7968,
  "competition_slug": "google-quest-challenge",
  "team_id": 4015616,
  "solution_url": "/competitions/google-quest-challenge/writeups/khoi-nguyen-12th-place-post-processing"
}