{
  "id": 69366,
  "title": "Order of Ids in the submission file matter!",
  "url": "/competitions/human-protein-atlas-image-classification/discussion/69366",
  "author_name": "Venky Krishnamani",
  "post_date": "2018-10-23T08:51:30.153000",
  "votes": 37,
  "comment_count": 21,
  "views": 0,
  "content": "<p>Seasoned Kagglers might already know that the order of <code>Ids</code> in the submission files matters. Not sure... but after I reordered the <code>Ids</code> according to <code>sample_submission.csv</code> my score jumped from <code>0.088</code> to <code>0.394</code>!</p>\n\n<p>I must have missed reading this in the rules/formatting guidelines???</p>",
  "messages": [
    {
      "id": 408659,
      "postDate": "2018-10-23T08:51:30.153Z",
      "content": "<p>Seasoned Kagglers might already know that the order of <code>Ids</code> in the submission files matters. Not sure... but after I reordered the <code>Ids</code> according to <code>sample_submission.csv</code> my score jumped from <code>0.088</code> to <code>0.394</code>!</p>\n\n<p>I must have missed reading this in the rules/formatting guidelines???</p>",
      "rawMarkdown": "Seasoned Kagglers might already know that the order of `Ids` in the submission files matters. Not sure... but after I reordered the `Ids` according to `sample_submission.csv` my score jumped from `0.088` to `0.394`!\n\nI must have missed reading this in the rules/formatting guidelines???",
      "votes": 37
    },
    {
      "id": 409225,
      "postDate": "2018-10-24T01:16:43.657Z",
      "content": "<p>Looks like they loaded the submission to a list and expected it to have the exact same order as the sample one, instead of loading everything to a lookup table.</p>",
      "rawMarkdown": "Looks like they loaded the submission to a list and expected it to have the exact same order as the sample one, instead of loading everything to a lookup table.",
      "votes": 1
    },
    {
      "id": 409041,
      "postDate": "2018-10-23T18:48:15.380Z",
      "content": "<p>I confirmed this too. see my <a href=\"https://www.kaggle.com/zhugds/does-order-of-test-ids-matter\">kernel</a>.</p>",
      "rawMarkdown": "I confirmed this too. see my [kernel](https://www.kaggle.com/zhugds/does-order-of-test-ids-matter).",
      "votes": 1
    },
    {
      "id": 413370,
      "postDate": "2018-10-31T20:04:38.087Z",
      "content": "<p>Saved my day.</p>\n\n<p>After creating the dataframe that is ready for submission </p>\n\n<p>subm_df= subm_df.sort_index()</p>\n\n<p>can give you the correct order.</p>",
      "rawMarkdown": "Saved my day.\n\nAfter creating the dataframe that is ready for submission \n\nsubm_df= subm_df.sort_index()\n\ncan give you the correct order.",
      "votes": 2
    },
    {
      "id": 408937,
      "postDate": "2018-10-23T16:15:17.943Z",
      "content": "<p>This doesn't make sense, could the organizers please comment on this.</p>",
      "rawMarkdown": "This doesn't make sense, could the organizers please comment on this.",
      "votes": 2,
      "replies": [
        {
          "id": 408948,
          "postDate": "2018-10-23T16:21:27.960Z",
          "content": "<p>Well.... someone decided to calculate the metrics using an iterator instead of making a proper dictionary with ids. </p>",
          "rawMarkdown": "Well.... someone decided to calculate the metrics using an iterator instead of making a proper dictionary with ids. ",
          "votes": 3
        }
      ]
    },
    {
      "id": 452893,
      "postDate": "2019-01-09T10:17:05.890Z",
      "content": "<p>Is kaggle have solved the problem? </p>",
      "rawMarkdown": "Is kaggle have solved the problem? ",
      "replies": [
        {
          "id": 453384,
          "postDate": "2019-01-10T05:26:01.050Z",
          "content": "<p>This shouldn't be a problem anymore</p>",
          "rawMarkdown": "This shouldn't be a problem anymore"
        }
      ]
    },
    {
      "id": 411726,
      "postDate": "2018-10-28T22:12:51.513Z",
      "content": "<p>Hmm... nice observation. I always thought that there is some procedure similar to merge by <code>Ids</code> (<code>sample_submission.csv</code> and <code>valid_submission.csv</code>), so order of test samples really doesn't matter. \nIn any case, it is written in the settings of <em>InClass</em> competitions when you are the host. Now it is necessary to clarify and make the official documentation.</p>\n\n<p><a href=\"/venkykrishna\">@venkykrishna</a>, Is there any feedback from Kaggle Team?</p>",
      "rawMarkdown": "Hmm... nice observation. I always thought that there is some procedure similar to merge by `Ids` (`sample_submission.csv` and `valid_submission.csv`), so order of test samples really doesn't matter. \nIn any case, it is written in the settings of *InClass* competitions when you are the host. Now it is necessary to clarify and make the official documentation.\n\n@venkykrishna, Is there any feedback from Kaggle Team?"
    },
    {
      "id": 409988,
      "postDate": "2018-10-25T06:53:04.180Z",
      "content": "<p>Keen eye!</p>",
      "rawMarkdown": "Keen eye!"
    },
    {
      "id": 409637,
      "postDate": "2018-10-24T16:18:15.857Z",
      "content": "<p>The expected order of Ids and predictions is specified in <code>sample_submission.csv</code> and that holds for all Kaggle competitions. In many instances - depending on metrics and the type of public LB calculation - it doesn't matter if the Id order is the same as in sample, as long as all Ids are there. However, I have always submitted them in the same order.</p>\n\n<p>Out of curiosity: what would be the reason in the first place for submitting Ids out of order? Maybe that's laid out somehow in kernels, but I haven't looked closely.</p>",
      "rawMarkdown": "The expected order of Ids and predictions is specified in `sample_submission.csv` and that holds for all Kaggle competitions. In many instances - depending on metrics and the type of public LB calculation - it doesn't matter if the Id order is the same as in sample, as long as all Ids are there. However, I have always submitted them in the same order.\n\nOut of curiosity: what would be the reason in the first place for submitting Ids out of order? Maybe that's laid out somehow in kernels, but I haven't looked closely.",
      "replies": [
        {
          "id": 409663,
          "postDate": "2018-10-24T16:56:20.340Z",
          "content": "<p>Do you know if the above is mentioned in the competition rules or kaggle general rules? I cannot seem to find it.</p>\n\n<p>If you read files directly from the <code>test</code> directory, the order will obviously not be maintained. <code>sample_submission.csv</code> I assumed was just a guideline for formatting.</p>",
          "rawMarkdown": "Do you know if the above is mentioned in the competition rules or kaggle general rules? I cannot seem to find it.\n\nIf you read files directly from the `test` directory, the order will obviously not be maintained. `sample_submission.csv` I assumed was just a guideline for formatting."
        },
        {
          "id": 409682,
          "postDate": "2018-10-24T17:36:41.820Z",
          "content": "<blockquote>\n  <p>Do you know if the above is mentioned in the competition rules or kaggle general rules?</p>\n</blockquote>\n\n<p>It doesn't seem like it is spelled out for this competition, though <code>sample_submission.csv</code> is meant to be a template file for everything other than the contents of predicted columns.</p>\n\n<p>I have posted a quick fix for this problem <a href=\"https://www.kaggle.com/c/human-protein-atlas-image-classification/discussion/69537\"><strong>here</strong></a>.</p>",
          "rawMarkdown": "&gt; Do you know if the above is mentioned in the competition rules or kaggle general rules?\n\nIt doesn't seem like it is spelled out for this competition, though `sample_submission.csv` is meant to be a template file for everything other than the contents of predicted columns.\n\nI have posted a quick fix for this problem [__here__](https://www.kaggle.com/c/human-protein-atlas-image-classification/discussion/69537)."
        }
      ]
    },
    {
      "id": 408959,
      "postDate": "2018-10-23T16:44:27.660Z",
      "content": "<p>If it is the case, I would like to say to the organizers that I really think about them((( I spent a week trying to figure out why my validation score is 0.5+ <a href=\"https://www.kaggle.com/iafoss/pretrained-resnet34-with-rgby-fast-ai\">https://www.kaggle.com/iafoss/pretrained-resnet34-with-rgby-fast-ai</a> (and even 0.7+ with some adjustment) while the test score is 0.06( I already gave up on the competition and wanted to check it out in a month or two...</p>",
      "rawMarkdown": "If it is the case, I would like to say to the organizers that I really think about them((( I spent a week trying to figure out why my validation score is 0.5+ https://www.kaggle.com/iafoss/pretrained-resnet34-with-rgby-fast-ai (and even 0.7+ with some adjustment) while the test score is 0.06( I already gave up on the competition and wanted to check it out in a month or two...",
      "replies": [
        {
          "id": 408963,
          "postDate": "2018-10-23T16:49:15.183Z",
          "content": "<p>Yep... this is the case, just got a jump from .05 to .2xx (nothing great in LB, but definitely into the competition now, and going back to known practices instead of crazy trips I was trying because of this bug). </p>",
          "rawMarkdown": "Yep... this is the case, just got a jump from .05 to .2xx (nothing great in LB, but definitely into the competition now, and going back to known practices instead of crazy trips I was trying because of this bug). ",
          "votes": 2
        },
        {
          "id": 409000,
          "postDate": "2018-10-23T17:49:15.577Z",
          "content": "<p>Got my 0.432 after reordering... </p>",
          "rawMarkdown": "Got my 0.432 after reordering... ",
          "votes": 3
        }
      ]
    },
    {
      "id": 408936,
      "postDate": "2018-10-23T16:14:16.077Z",
      "content": "<p>Whoa... thank goodness.... I thougt I was getting crazy for thinking all my (little) knowledge was simply useless for this competition.... </p>",
      "rawMarkdown": "Whoa... thank goodness.... I thougt I was getting crazy for thinking all my (little) knowledge was simply useless for this competition.... \n\n\n"
    },
    {
      "id": 408803,
      "postDate": "2018-10-23T13:37:30.500Z",
      "content": "<p>Well spottet!</p>",
      "rawMarkdown": "Well spottet!"
    },
    {
      "id": 408767,
      "postDate": "2018-10-23T12:33:14.810Z",
      "content": "<p>Can you point where it is defined in the rules/formatting guidelines?</p>",
      "rawMarkdown": "Can you point where it is defined in the rules/formatting guidelines?",
      "replies": [
        {
          "id": 408919,
          "postDate": "2018-10-23T15:56:04.627Z",
          "content": "<p>I couldn’t find it explicitly mentioned anywhere in the competition guidelines. </p>",
          "rawMarkdown": "I couldn’t find it explicitly mentioned anywhere in the competition guidelines. "
        },
        {
          "id": 409066,
          "postDate": "2018-10-23T19:44:04.267Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 409151,
          "postDate": "2018-10-23T20:49:57.797Z",
          "content": "<p>As Daniel Möller pointed out, the discussion you are referencing was talking about the order of <code>target</code> NOT the order of <code>Id</code>. This thread is a discussion about the order of <code>Id</code> in the submission file.</p>",
          "rawMarkdown": "As Daniel Möller pointed out, the discussion you are referencing was talking about the order of `target` NOT the order of `Id`. This thread is a discussion about the order of `Id` in the submission file.",
          "votes": 2
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 409225,
      "author_name": "Khoi Nguyen",
      "author_url": "",
      "post_date": "2018-10-24T01:16:43.657000",
      "content": "<p>Looks like they loaded the submission to a list and expected it to have the exact same order as the sample one, instead of loading everything to a lookup table.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 409041,
      "author_name": "june",
      "author_url": "",
      "post_date": "2018-10-23T18:48:15.380000",
      "content": "<p>I confirmed this too. see my <a href=\"https://www.kaggle.com/zhugds/does-order-of-test-ids-matter\">kernel</a>.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 413370,
      "author_name": "stumpen",
      "author_url": "",
      "post_date": "2018-10-31T20:04:38.087000",
      "content": "<p>Saved my day.</p>\n\n<p>After creating the dataframe that is ready for submission </p>\n\n<p>subm_df= subm_df.sort_index()</p>\n\n<p>can give you the correct order.</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 408937,
      "author_name": "Robert",
      "author_url": "",
      "post_date": "2018-10-23T16:15:17.943000",
      "content": "<p>This doesn't make sense, could the organizers please comment on this.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 408948,
          "author_name": "Daniel Möller",
          "author_url": "",
          "post_date": "2018-10-23T16:21:27.960000",
          "content": "<p>Well.... someone decided to calculate the metrics using an iterator instead of making a proper dictionary with ids. </p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 452893,
      "author_name": "BenChur",
      "author_url": "",
      "post_date": "2019-01-09T10:17:05.890000",
      "content": "<p>Is kaggle have solved the problem? </p>",
      "votes": 0,
      "replies": [
        {
          "id": 453384,
          "author_name": "William Horton",
          "author_url": "",
          "post_date": "2019-01-10T05:26:01.050000",
          "content": "<p>This shouldn't be a problem anymore</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 411726,
      "author_name": "Sergey Bryansky",
      "author_url": "",
      "post_date": "2018-10-28T22:12:51.513000",
      "content": "<p>Hmm... nice observation. I always thought that there is some procedure similar to merge by <code>Ids</code> (<code>sample_submission.csv</code> and <code>valid_submission.csv</code>), so order of test samples really doesn't matter. \nIn any case, it is written in the settings of <em>InClass</em> competitions when you are the host. Now it is necessary to clarify and make the official documentation.</p>\n\n<p><a href=\"/venkykrishna\">@venkykrishna</a>, Is there any feedback from Kaggle Team?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 409988,
      "author_name": "Denis Kanonik",
      "author_url": "",
      "post_date": "2018-10-25T06:53:04.180000",
      "content": "<p>Keen eye!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 409637,
      "author_name": "Tilii",
      "author_url": "",
      "post_date": "2018-10-24T16:18:15.857000",
      "content": "<p>The expected order of Ids and predictions is specified in <code>sample_submission.csv</code> and that holds for all Kaggle competitions. In many instances - depending on metrics and the type of public LB calculation - it doesn't matter if the Id order is the same as in sample, as long as all Ids are there. However, I have always submitted them in the same order.</p>\n\n<p>Out of curiosity: what would be the reason in the first place for submitting Ids out of order? Maybe that's laid out somehow in kernels, but I haven't looked closely.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 409663,
          "author_name": "Venky Krishnamani",
          "author_url": "",
          "post_date": "2018-10-24T16:56:20.340000",
          "content": "<p>Do you know if the above is mentioned in the competition rules or kaggle general rules? I cannot seem to find it.</p>\n\n<p>If you read files directly from the <code>test</code> directory, the order will obviously not be maintained. <code>sample_submission.csv</code> I assumed was just a guideline for formatting.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 409682,
          "author_name": "Tilii",
          "author_url": "",
          "post_date": "2018-10-24T17:36:41.820000",
          "content": "<blockquote>\n  <p>Do you know if the above is mentioned in the competition rules or kaggle general rules?</p>\n</blockquote>\n\n<p>It doesn't seem like it is spelled out for this competition, though <code>sample_submission.csv</code> is meant to be a template file for everything other than the contents of predicted columns.</p>\n\n<p>I have posted a quick fix for this problem <a href=\"https://www.kaggle.com/c/human-protein-atlas-image-classification/discussion/69537\"><strong>here</strong></a>.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 408959,
      "author_name": "Iafoss",
      "author_url": "",
      "post_date": "2018-10-23T16:44:27.660000",
      "content": "<p>If it is the case, I would like to say to the organizers that I really think about them((( I spent a week trying to figure out why my validation score is 0.5+ <a href=\"https://www.kaggle.com/iafoss/pretrained-resnet34-with-rgby-fast-ai\">https://www.kaggle.com/iafoss/pretrained-resnet34-with-rgby-fast-ai</a> (and even 0.7+ with some adjustment) while the test score is 0.06( I already gave up on the competition and wanted to check it out in a month or two...</p>",
      "votes": 0,
      "replies": [
        {
          "id": 408963,
          "author_name": "Daniel Möller",
          "author_url": "",
          "post_date": "2018-10-23T16:49:15.183000",
          "content": "<p>Yep... this is the case, just got a jump from .05 to .2xx (nothing great in LB, but definitely into the competition now, and going back to known practices instead of crazy trips I was trying because of this bug). </p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 409000,
          "author_name": "Iafoss",
          "author_url": "",
          "post_date": "2018-10-23T17:49:15.577000",
          "content": "<p>Got my 0.432 after reordering... </p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 408936,
      "author_name": "Daniel Möller",
      "author_url": "",
      "post_date": "2018-10-23T16:14:16.077000",
      "content": "<p>Whoa... thank goodness.... I thougt I was getting crazy for thinking all my (little) knowledge was simply useless for this competition.... </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 408803,
      "author_name": "WolfgangReuter",
      "author_url": "",
      "post_date": "2018-10-23T13:37:30.500000",
      "content": "<p>Well spottet!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 408767,
      "author_name": "pi-null-mezon",
      "author_url": "",
      "post_date": "2018-10-23T12:33:14.810000",
      "content": "<p>Can you point where it is defined in the rules/formatting guidelines?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 408919,
          "author_name": "Venky Krishnamani",
          "author_url": "",
          "post_date": "2018-10-23T15:56:04.627000",
          "content": "<p>I couldn’t find it explicitly mentioned anywhere in the competition guidelines. </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 409066,
          "author_name": "",
          "author_url": "",
          "post_date": "2018-10-23T19:44:04.267000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 409151,
          "author_name": "Venky Krishnamani",
          "author_url": "",
          "post_date": "2018-10-23T20:49:57.797000",
          "content": "<p>As Daniel Möller pointed out, the discussion you are referencing was talking about the order of <code>target</code> NOT the order of <code>Id</code>. This thread is a discussion about the order of <code>Id</code> in the submission file.</p>",
          "votes": 2,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "408659": "Seasoned Kagglers might already know that the order of `Ids` in the submission files matters. Not sure... but after I reordered the `Ids` according to `sample_submission.csv` my score jumped from `0.088` to `0.394`!\n\nI must have missed reading this in the rules/formatting guidelines???",
    "409225": "Looks like they loaded the submission to a list and expected it to have the exact same order as the sample one, instead of loading everything to a lookup table.",
    "409041": "I confirmed this too. see my [kernel](https://www.kaggle.com/zhugds/does-order-of-test-ids-matter).",
    "413370": "Saved my day.\n\nAfter creating the dataframe that is ready for submission \n\nsubm_df= subm_df.sort_index()\n\ncan give you the correct order.",
    "408937": "This doesn't make sense, could the organizers please comment on this.",
    "452893": "Is kaggle have solved the problem? ",
    "411726": "Hmm... nice observation. I always thought that there is some procedure similar to merge by `Ids` (`sample_submission.csv` and `valid_submission.csv`), so order of test samples really doesn't matter. \nIn any case, it is written in the settings of *InClass* competitions when you are the host. Now it is necessary to clarify and make the official documentation.\n\n@venkykrishna, Is there any feedback from Kaggle Team?",
    "409988": "Keen eye!",
    "409637": "The expected order of Ids and predictions is specified in `sample_submission.csv` and that holds for all Kaggle competitions. In many instances - depending on metrics and the type of public LB calculation - it doesn't matter if the Id order is the same as in sample, as long as all Ids are there. However, I have always submitted them in the same order.\n\nOut of curiosity: what would be the reason in the first place for submitting Ids out of order? Maybe that's laid out somehow in kernels, but I haven't looked closely.",
    "408959": "If it is the case, I would like to say to the organizers that I really think about them((( I spent a week trying to figure out why my validation score is 0.5+ https://www.kaggle.com/iafoss/pretrained-resnet34-with-rgby-fast-ai (and even 0.7+ with some adjustment) while the test score is 0.06( I already gave up on the competition and wanted to check it out in a month or two...",
    "408936": "Whoa... thank goodness.... I thougt I was getting crazy for thinking all my (little) knowledge was simply useless for this competition.... \n\n\n",
    "408803": "Well spottet!",
    "408767": "Can you point where it is defined in the rules/formatting guidelines?"
  }
}