{
  "id": 110586,
  "title": "Submission error solution",
  "url": "/competitions/Kannada-MNIST/discussion/110586",
  "author_name": "",
  "post_date": "2019-09-29T13:09:30.978603200Z",
  "votes": 2,
  "comment_count": 3,
  "views": 0,
  "content": "<p>The reason of this error is 'id' column in submission file. If you will use sample_submission.csv and just replace 'label' column with your predictions - then you will get submission error.\nTo solve this problem I recreated 'id' column using np.arange function:</p>\n\n<p><code>\nsub_preds = model.predict_classes(test_df)\nid_col = np.arange(sub_preds.shape[0])\nsubmission = pd.DataFrame({'id': id_col, 'label': sub_preds})\nsubmission.to_csv('sub.csv', index = False)\n</code></p>\n\n<p>I hope it will help anyone who faced this problem.</p>",
  "messages": [
    {
      "id": "636400",
      "postDate": "09/29/2019 13:09:30",
      "content": "<p>The reason of this error is 'id' column in submission file. If you will use sample_submission.csv and just replace 'label' column with your predictions - then you will get submission error.\nTo solve this problem I recreated 'id' column using np.arange function:</p>\n\n<p><code>\nsub_preds = model.predict_classes(test_df)\nid_col = np.arange(sub_preds.shape[0])\nsubmission = pd.DataFrame({'id': id_col, 'label': sub_preds})\nsubmission.to_csv('sub.csv', index = False)\n</code></p>\n\n<p>I hope it will help anyone who faced this problem.</p>",
      "rawMarkdown": "The reason of this error is 'id' column in submission file. If you will use sample_submission.csv and just replace 'label' column with your predictions - then you will get submission error.\nTo solve this problem I recreated 'id' column using np.arange function:\n\n```\nsub_preds = model.predict_classes(test_df)\nid_col = np.arange(sub_preds.shape[0])\nsubmission = pd.DataFrame({'id': id_col, 'label': sub_preds})\nsubmission.to_csv('sub.csv', index = False)\n```\n\nI hope it will help anyone who faced this problem.",
      "votes": null
    },
    {
      "id": "639602",
      "postDate": "10/03/2019 11:47:15",
      "content": "<p>Not working - still have error. Very strange - I've used different algorithms with the same approach to create submission.csv. in some cases it works, in some - it doesn't!</p>",
      "rawMarkdown": "Not working - still have error. Very strange - I've used different algorithms with the same approach to create submission.csv. in some cases it works, in some - it doesn't!",
      "votes": null
    },
    {
      "id": "639701",
      "postDate": "10/03/2019 12:59:59",
      "content": "<p>Hm very strange, I'm using this solution for all my submissions and it works. </p>",
      "rawMarkdown": "Hm very strange, I'm using this solution for all my submissions and it works.",
      "votes": null
    },
    {
      "id": "648089",
      "postDate": "10/13/2019 18:10:14",
      "content": "<p>Nice try👍 !! I kinda did the same using <code>pd.Series(range(0, 5000))</code> still it is not accepting!!</p>",
      "rawMarkdown": "Nice try👍 !! I kinda did the same using `pd.Series(range(0, 5000))` still it is not accepting!!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 639602,
      "author_name": "serg132003",
      "author_url": "",
      "post_date": "10/03/2019 11:47:15",
      "content": "<p>Not working - still have error. Very strange - I've used different algorithms with the same approach to create submission.csv. in some cases it works, in some - it doesn't!</p>",
      "votes": null,
      "replies": [
        {
          "id": 639701,
          "author_name": "trolukovich",
          "author_url": "",
          "post_date": "10/03/2019 12:59:59",
          "content": "<p>Hm very strange, I'm using this solution for all my submissions and it works. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 648089,
      "author_name": "tranquilkd",
      "author_url": "",
      "post_date": "10/13/2019 18:10:14",
      "content": "<p>Nice try👍 !! I kinda did the same using <code>pd.Series(range(0, 5000))</code> still it is not accepting!!</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "636400": "The reason of this error is 'id' column in submission file. If you will use sample_submission.csv and just replace 'label' column with your predictions - then you will get submission error.\nTo solve this problem I recreated 'id' column using np.arange function:\n\n```\nsub_preds = model.predict_classes(test_df)\nid_col = np.arange(sub_preds.shape[0])\nsubmission = pd.DataFrame({'id': id_col, 'label': sub_preds})\nsubmission.to_csv('sub.csv', index = False)\n```\n\nI hope it will help anyone who faced this problem.",
    "639602": "Not working - still have error. Very strange - I've used different algorithms with the same approach to create submission.csv. in some cases it works, in some - it doesn't!",
    "639701": "Hm very strange, I'm using this solution for all my submissions and it works.",
    "648089": "Nice try👍 !! I kinda did the same using `pd.Series(range(0, 5000))` still it is not accepting!!"
  },
  "source": "meta"
}