{
  "id": 102718,
  "title": "How to submit fast during kernel outage",
  "url": "/competitions/aptos2019-blindness-detection/discussion/102718",
  "author_name": "",
  "post_date": "2019-08-04T09:23:08.528907800Z",
  "votes": 44,
  "comment_count": 13,
  "views": 0,
  "content": "<p>Hi all,</p>\n\n<p>Seen several people asking how submissions are still occurring. Here is the trick, but beware that this does not score any of the private data.</p>\n\n<ol>\n<li>Train model in kernel or local machine.</li>\n<li>Predict for all images in test.csv and save predictions to .csv file along with the id_code.</li>\n<li>Create a new kernel <strong>but do not enable the GPU</strong>.</li>\n<li>Add your saved predictions as a dataset and load it into the kernel.</li>\n<li>Add the following code:</li>\n</ol>\n\n<p>```\nimport numpy as np \nimport pandas as pd </p>\n\n<h1>grab your predictions and the sample submission</h1>\n\n<p>my_predictions = pd.read_csv('../input/my_predictions/my_predictions.csv')\nsample_submission = pd.read_csv('../input/aptos2019-blindness-detection/sample_submission.csv')</p>\n\n<h1>add your predictions and replace nans for the private data set</h1>\n\n<p>sample_submission.drop(columns=['diagnosis'], inplace=True)\nsample_submission = pd.merge(sample_submission, my_predictions, how='left', left_on='id_code', right_on='id_code')\nsample_submission.fillna(0,inplace=True)</p>\n\n<h1>you must convert to int or it will fail @ submission</h1>\n\n<p>sample_submission['diagnosis'] = sample_submission['diagnosis'].astype('int64') </p>\n\n<p>sample_submission.to_csv('submission.csv', index=False)</p>\n\n<p>```</p>\n\n<p>This will submit super fast, but as I say just be aware you're only providing predictions for the public test set. Hopefully Kaggle will fix this soon.</p>",
  "messages": [
    {
      "id": "591805",
      "postDate": "08/04/2019 09:23:08",
      "content": "<p>Hi all,</p>\n\n<p>Seen several people asking how submissions are still occurring. Here is the trick, but beware that this does not score any of the private data.</p>\n\n<ol>\n<li>Train model in kernel or local machine.</li>\n<li>Predict for all images in test.csv and save predictions to .csv file along with the id_code.</li>\n<li>Create a new kernel <strong>but do not enable the GPU</strong>.</li>\n<li>Add your saved predictions as a dataset and load it into the kernel.</li>\n<li>Add the following code:</li>\n</ol>\n\n<p>```\nimport numpy as np \nimport pandas as pd </p>\n\n<h1>grab your predictions and the sample submission</h1>\n\n<p>my_predictions = pd.read_csv('../input/my_predictions/my_predictions.csv')\nsample_submission = pd.read_csv('../input/aptos2019-blindness-detection/sample_submission.csv')</p>\n\n<h1>add your predictions and replace nans for the private data set</h1>\n\n<p>sample_submission.drop(columns=['diagnosis'], inplace=True)\nsample_submission = pd.merge(sample_submission, my_predictions, how='left', left_on='id_code', right_on='id_code')\nsample_submission.fillna(0,inplace=True)</p>\n\n<h1>you must convert to int or it will fail @ submission</h1>\n\n<p>sample_submission['diagnosis'] = sample_submission['diagnosis'].astype('int64') </p>\n\n<p>sample_submission.to_csv('submission.csv', index=False)</p>\n\n<p>```</p>\n\n<p>This will submit super fast, but as I say just be aware you're only providing predictions for the public test set. Hopefully Kaggle will fix this soon.</p>",
      "rawMarkdown": "Hi all,\n\nSeen several people asking how submissions are still occurring. Here is the trick, but beware that this does not score any of the private data.\n\n1. Train model in kernel or local machine.\n2. Predict for all images in test.csv and save predictions to .csv file along with the id_code.\n3. Create a new kernel **but do not enable the GPU**.\n4. Add your saved predictions as a dataset and load it into the kernel.\n5. Add the following code:\n\n```\nimport numpy as np \nimport pandas as pd \n\n# grab your predictions and the sample submission\n\nmy_predictions = pd.read_csv('../input/my_predictions/my_predictions.csv')\nsample_submission = pd.read_csv('../input/aptos2019-blindness-detection/sample_submission.csv')\n\n# add your predictions and replace nans for the private data set\n\nsample_submission.drop(columns=['diagnosis'], inplace=True)\nsample_submission = pd.merge(sample_submission, my_predictions, how='left', left_on='id_code', right_on='id_code')\nsample_submission.fillna(0,inplace=True)\n\n# you must convert to int or it will fail @ submission\n\nsample_submission['diagnosis'] = sample_submission['diagnosis'].astype('int64') \n\nsample_submission.to_csv('submission.csv', index=False)\n\n```\n\nThis will submit super fast, but as I say just be aware you're only providing predictions for the public test set. Hopefully Kaggle will fix this soon.",
      "votes": null
    },
    {
      "id": "591822",
      "postDate": "08/04/2019 09:54:18",
      "content": "<p>Thanks, you can actually also just make a new kernel/dataset from the output of your previous submit script.</p>",
      "rawMarkdown": "Thanks, you can actually also just make a new kernel/dataset from the output of your previous submit script.",
      "votes": null
    },
    {
      "id": "591855",
      "postDate": "08/04/2019 11:31:02",
      "content": "<p>Thanks, it works very well for me. 💪 </p>",
      "rawMarkdown": "Thanks, it works very well for me. 💪",
      "votes": null
    },
    {
      "id": "591861",
      "postDate": "08/04/2019 11:42:35",
      "content": "<p>today you have a trouble  when summit the kernel, I still mett Kernel Threw Error</p>",
      "rawMarkdown": "today you have a trouble  when summit the kernel, I still mett Kernel Threw Error",
      "votes": null
    },
    {
      "id": "591863",
      "postDate": "08/04/2019 11:43:16",
      "content": "<p>that method is work??</p>",
      "rawMarkdown": "that method is work??",
      "votes": null
    },
    {
      "id": "591872",
      "postDate": "08/04/2019 11:58:00",
      "content": "<p>Genius idea, this trick indeed solved my recent submission error.</p>",
      "rawMarkdown": "Genius idea, this trick indeed solved my recent submission error.",
      "votes": null
    },
    {
      "id": "591889",
      "postDate": "08/04/2019 12:22:51",
      "content": "<p>sample_submission['diagnosis'] =   ?? what means, should move?</p>",
      "rawMarkdown": "sample_submission['diagnosis'] =   ?? what means, should move?",
      "votes": null
    },
    {
      "id": "591891",
      "postDate": "08/04/2019 12:24:49",
      "content": "<p>See the next line, it just displays like this in code block.</p>",
      "rawMarkdown": "See the next line, it just displays like this in code block.",
      "votes": null
    },
    {
      "id": "591893",
      "postDate": "08/04/2019 12:33:23",
      "content": "<p>Thank you sinerely, it work for me when the \"kernel Threw error\"  happend for me , And faster to save the time. wish have a good day!</p>",
      "rawMarkdown": "Thank you sinerely, it work for me when the \"kernel Threw error\"  happend for me , And faster to save the time. wish have a good day!",
      "votes": null
    },
    {
      "id": "591895",
      "postDate": "08/04/2019 12:35:42",
      "content": "<p>Thanks, this will save some time!</p>",
      "rawMarkdown": "Thanks, this will save some time!",
      "votes": null
    },
    {
      "id": "591946",
      "postDate": "08/04/2019 14:17:25",
      "content": "<p>What I did: \n- run testing locally and get the submission csv\n- upload the csv as part of a customized dataset\n- create a kernel with GPU off\n- run the code provided above by replacing <code>my_predictions = pd.read_csv('../input/my_predictions/my_predictions.csv')</code> with your own submission csv</p>",
      "rawMarkdown": "What I did: \n- run testing locally and get the submission csv\n- upload the csv as part of a customized dataset\n- create a kernel with GPU off\n- run the code provided above by replacing `my_predictions = pd.read_csv('../input/my_predictions/my_predictions.csv')` with your own submission csv",
      "votes": null
    },
    {
      "id": "591974",
      "postDate": "08/04/2019 15:23:18",
      "content": "<p>Great... It works</p>",
      "rawMarkdown": "Great... It works",
      "votes": null
    },
    {
      "id": "592002",
      "postDate": "08/04/2019 15:55:34",
      "content": "<p>I did that but when submitted the kernel threw 'submission error' anyways. I checked the submission.csv in the output files and everything looked ok. ?</p>",
      "rawMarkdown": "I did that but when submitted the kernel threw 'submission error' anyways. I checked the submission.csv in the output files and everything looked ok. ?",
      "votes": null
    },
    {
      "id": "593892",
      "postDate": "08/07/2019 08:31:02",
      "content": "<p><code>sample_submission.fillna(0,inplace=True)</code> this line  use for ? can we move it?</p>",
      "rawMarkdown": "`sample_submission.fillna(0,inplace=True)` this line  use for ? can we move it?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 591822,
      "author_name": "philippsinger",
      "author_url": "",
      "post_date": "08/04/2019 09:54:18",
      "content": "<p>Thanks, you can actually also just make a new kernel/dataset from the output of your previous submit script.</p>",
      "votes": null,
      "replies": [
        {
          "id": 592002,
          "author_name": "sam1320",
          "author_url": "",
          "post_date": "08/04/2019 15:55:34",
          "content": "<p>I did that but when submitted the kernel threw 'submission error' anyways. I checked the submission.csv in the output files and everything looked ok. ?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 591855,
      "author_name": "jiangchun",
      "author_url": "",
      "post_date": "08/04/2019 11:31:02",
      "content": "<p>Thanks, it works very well for me. 💪 </p>",
      "votes": null,
      "replies": [
        {
          "id": 591861,
          "author_name": "jiangkun2",
          "author_url": "",
          "post_date": "08/04/2019 11:42:35",
          "content": "<p>today you have a trouble  when summit the kernel, I still mett Kernel Threw Error</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 591863,
          "author_name": "jiangkun2",
          "author_url": "",
          "post_date": "08/04/2019 11:43:16",
          "content": "<p>that method is work??</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 591946,
          "author_name": "jiangchun",
          "author_url": "",
          "post_date": "08/04/2019 14:17:25",
          "content": "<p>What I did: \n- run testing locally and get the submission csv\n- upload the csv as part of a customized dataset\n- create a kernel with GPU off\n- run the code provided above by replacing <code>my_predictions = pd.read_csv('../input/my_predictions/my_predictions.csv')</code> with your own submission csv</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 591872,
      "author_name": "mikelkl",
      "author_url": "",
      "post_date": "08/04/2019 11:58:00",
      "content": "<p>Genius idea, this trick indeed solved my recent submission error.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 591889,
      "author_name": "jiangkun2",
      "author_url": "",
      "post_date": "08/04/2019 12:22:51",
      "content": "<p>sample_submission['diagnosis'] =   ?? what means, should move?</p>",
      "votes": null,
      "replies": [
        {
          "id": 591891,
          "author_name": "taindow",
          "author_url": "",
          "post_date": "08/04/2019 12:24:49",
          "content": "<p>See the next line, it just displays like this in code block.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 591893,
          "author_name": "jiangkun2",
          "author_url": "",
          "post_date": "08/04/2019 12:33:23",
          "content": "<p>Thank you sinerely, it work for me when the \"kernel Threw error\"  happend for me , And faster to save the time. wish have a good day!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 591895,
      "author_name": "dimitreoliveira",
      "author_url": "",
      "post_date": "08/04/2019 12:35:42",
      "content": "<p>Thanks, this will save some time!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 591974,
      "author_name": "apthagowda",
      "author_url": "",
      "post_date": "08/04/2019 15:23:18",
      "content": "<p>Great... It works</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 593892,
      "author_name": "ggbrother",
      "author_url": "",
      "post_date": "08/07/2019 08:31:02",
      "content": "<p><code>sample_submission.fillna(0,inplace=True)</code> this line  use for ? can we move it?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "591805": "Hi all,\n\nSeen several people asking how submissions are still occurring. Here is the trick, but beware that this does not score any of the private data.\n\n1. Train model in kernel or local machine.\n2. Predict for all images in test.csv and save predictions to .csv file along with the id_code.\n3. Create a new kernel **but do not enable the GPU**.\n4. Add your saved predictions as a dataset and load it into the kernel.\n5. Add the following code:\n\n```\nimport numpy as np \nimport pandas as pd \n\n# grab your predictions and the sample submission\n\nmy_predictions = pd.read_csv('../input/my_predictions/my_predictions.csv')\nsample_submission = pd.read_csv('../input/aptos2019-blindness-detection/sample_submission.csv')\n\n# add your predictions and replace nans for the private data set\n\nsample_submission.drop(columns=['diagnosis'], inplace=True)\nsample_submission = pd.merge(sample_submission, my_predictions, how='left', left_on='id_code', right_on='id_code')\nsample_submission.fillna(0,inplace=True)\n\n# you must convert to int or it will fail @ submission\n\nsample_submission['diagnosis'] = sample_submission['diagnosis'].astype('int64') \n\nsample_submission.to_csv('submission.csv', index=False)\n\n```\n\nThis will submit super fast, but as I say just be aware you're only providing predictions for the public test set. Hopefully Kaggle will fix this soon.",
    "591822": "Thanks, you can actually also just make a new kernel/dataset from the output of your previous submit script.",
    "591855": "Thanks, it works very well for me. 💪",
    "591861": "today you have a trouble  when summit the kernel, I still mett Kernel Threw Error",
    "591863": "that method is work??",
    "591872": "Genius idea, this trick indeed solved my recent submission error.",
    "591889": "sample_submission['diagnosis'] =   ?? what means, should move?",
    "591891": "See the next line, it just displays like this in code block.",
    "591893": "Thank you sinerely, it work for me when the \"kernel Threw error\"  happend for me , And faster to save the time. wish have a good day!",
    "591895": "Thanks, this will save some time!",
    "591946": "What I did: \n- run testing locally and get the submission csv\n- upload the csv as part of a customized dataset\n- create a kernel with GPU off\n- run the code provided above by replacing `my_predictions = pd.read_csv('../input/my_predictions/my_predictions.csv')` with your own submission csv",
    "591974": "Great... It works",
    "592002": "I did that but when submitted the kernel threw 'submission error' anyways. I checked the submission.csv in the output files and everything looked ok. ?",
    "593892": "`sample_submission.fillna(0,inplace=True)` this line  use for ? can we move it?"
  },
  "source": "meta"
}