{
  "id": 82199,
  "title": "Submission",
  "url": "/competitions/humpback-whale-identification/discussion/82199",
  "author_name": "Benson Jin",
  "post_date": "2019-02-27T21:16:04.141000",
  "votes": -2,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I am new to doing Kaggle competitions, how do I make submission.csv ? </p>",
  "messages": [
    {
      "id": 480166,
      "postDate": "2019-02-27T21:28:59.920Z",
      "content": "<p>If you are making the submission from your own drive:\nWhen you are on the main Humpback Whale Identification page (where you see the overview, data, kernels icons), there is a submit predictions icon on the right;\nclick on the submit predictions icon --&gt; go to upload file --&gt; upload submission.csv --&gt; make submission\nIf you are using kaggle kernels:\nafter you have run the kernel --&gt; click on the output icon --&gt; click on submit to competition</p>",
      "rawMarkdown": "If you are making the submission from your own drive:\nWhen you are on the main Humpback Whale Identification page (where you see the overview, data, kernels icons), there is a submit predictions icon on the right;\nclick on the submit predictions icon --&gt; go to upload file --&gt; upload submission.csv --&gt; make submission\nIf you are using kaggle kernels:\nafter you have run the kernel --&gt; click on the output icon --&gt; click on submit to competition",
      "votes": 1,
      "replies": [
        {
          "id": 480172,
          "postDate": "2019-02-27T21:34:51.550Z",
          "content": "<p>How would I make the csv file itself, I know how to submit it.</p>",
          "rawMarkdown": "How would I make the csv file itself, I know how to submit it.",
          "votes": -2
        },
        {
          "id": 480191,
          "postDate": "2019-02-27T22:26:25.260Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 480194,
          "postDate": "2019-02-27T22:35:58.610Z",
          "content": "<p>I can try to help:\nIt can be done using pandas,\nyou can get a list of your top 5 predictions in a list_of_labels for the test images as in the sample submission file:\ne.g.:</p>\n\n<pre><code>import pandas as pd\ndataframe = pd.read_csv(\"sample_submission.csv\") # loads the sample submission file\nlist_of_images = dataframe.Image.values # list of the test images\nlist_of_labels = dataframe.Id.values # list of the labels from sample file, this is just for an example (you need to replace your own list of predictions here)\nname = 'submission' #now we can make a submission file called submission.csv\nsubmission = pd.DataFrame({'Image':list_of_images})\nsubmission['Id'] = list_of_labels # replace the labels with your own predictions\nsubmission.to_csv(f'{name}.csv',index=False)  # write your csv output\n</code></pre>\n\n<p>or you can replace your predictions in the sample file by doing:</p>\n\n<pre><code>dataframe = pd.read_csv('sample_submission.csv').set_index('Image')    \ndataframe.loc[list_of_images, 'Id'] = list_of_labels\ndataframe.to_csv(f'{name}.csv')  # write your csv output\n</code></pre>",
          "rawMarkdown": "I can try to help:\nIt can be done using pandas,\nyou can get a list of your top 5 predictions in a list_of_labels for the test images as in the sample submission file:\ne.g.:\n\n    import pandas as pd\n    dataframe = pd.read_csv(\"sample_submission.csv\") # loads the sample submission file\n    list_of_images = dataframe.Image.values # list of the test images\n    list_of_labels = dataframe.Id.values # list of the labels from sample file, this is just for an example (you need to replace your own list of predictions here)\n    name = 'submission' #now we can make a submission file called submission.csv\n    submission = pd.DataFrame({'Image':list_of_images})\n    submission['Id'] = list_of_labels # replace the labels with your own predictions\n    submission.to_csv(f'{name}.csv',index=False)  # write your csv output\n    \nor you can replace your predictions in the sample file by doing:\n\n    dataframe = pd.read_csv('sample_submission.csv').set_index('Image')    \n    dataframe.loc[list_of_images, 'Id'] = list_of_labels\n    dataframe.to_csv(f'{name}.csv')  # write your csv output\n\n",
          "votes": 4
        }
      ]
    },
    {
      "id": 480163,
      "postDate": "2019-02-27T21:16:04.140Z",
      "content": "<p>I am new to doing Kaggle competitions, how do I make submission.csv ? </p>",
      "rawMarkdown": "I am new to doing Kaggle competitions, how do I make submission.csv ? ",
      "votes": -2
    }
  ],
  "comments": [
    {
      "id": 480166,
      "author_name": "mlearner",
      "author_url": "",
      "post_date": "2019-02-27T21:28:59.920000",
      "content": "<p>If you are making the submission from your own drive:\nWhen you are on the main Humpback Whale Identification page (where you see the overview, data, kernels icons), there is a submit predictions icon on the right;\nclick on the submit predictions icon --&gt; go to upload file --&gt; upload submission.csv --&gt; make submission\nIf you are using kaggle kernels:\nafter you have run the kernel --&gt; click on the output icon --&gt; click on submit to competition</p>",
      "votes": 1,
      "replies": [
        {
          "id": 480172,
          "author_name": "Benson Jin",
          "author_url": "",
          "post_date": "2019-02-27T21:34:51.550000",
          "content": "<p>How would I make the csv file itself, I know how to submit it.</p>",
          "votes": -2,
          "replies": []
        },
        {
          "id": 480191,
          "author_name": "",
          "author_url": "",
          "post_date": "2019-02-27T22:26:25.260000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 480194,
          "author_name": "mlearner",
          "author_url": "",
          "post_date": "2019-02-27T22:35:58.610000",
          "content": "<p>I can try to help:\nIt can be done using pandas,\nyou can get a list of your top 5 predictions in a list_of_labels for the test images as in the sample submission file:\ne.g.:</p>\n\n<pre><code>import pandas as pd\ndataframe = pd.read_csv(\"sample_submission.csv\") # loads the sample submission file\nlist_of_images = dataframe.Image.values # list of the test images\nlist_of_labels = dataframe.Id.values # list of the labels from sample file, this is just for an example (you need to replace your own list of predictions here)\nname = 'submission' #now we can make a submission file called submission.csv\nsubmission = pd.DataFrame({'Image':list_of_images})\nsubmission['Id'] = list_of_labels # replace the labels with your own predictions\nsubmission.to_csv(f'{name}.csv',index=False)  # write your csv output\n</code></pre>\n\n<p>or you can replace your predictions in the sample file by doing:</p>\n\n<pre><code>dataframe = pd.read_csv('sample_submission.csv').set_index('Image')    \ndataframe.loc[list_of_images, 'Id'] = list_of_labels\ndataframe.to_csv(f'{name}.csv')  # write your csv output\n</code></pre>",
          "votes": 4,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "480166": "If you are making the submission from your own drive:\nWhen you are on the main Humpback Whale Identification page (where you see the overview, data, kernels icons), there is a submit predictions icon on the right;\nclick on the submit predictions icon --&gt; go to upload file --&gt; upload submission.csv --&gt; make submission\nIf you are using kaggle kernels:\nafter you have run the kernel --&gt; click on the output icon --&gt; click on submit to competition",
    "480163": "I am new to doing Kaggle competitions, how do I make submission.csv ? "
  }
}