{
  "id": 98879,
  "title": "Fastest cycle to check LB score",
  "url": "/competitions/aptos2019-blindness-detection/discussion/98879",
  "author_name": "",
  "post_date": "2019-07-07T08:58:44.335591200Z",
  "votes": 43,
  "comment_count": 7,
  "views": 0,
  "content": "<p>We can make the submit cycle faster with 2 points.</p>\n\n<p>1 You can make the submit phase faster with this method.\nCheck the data length of \"sample_submission.csv\" or \"test.csv\" like\n<code>\nsub = pd.read_csv('../input/sample_submission.csv') <br>\nif len(sub) &amp;lt; 2000:\n    sub.to_csv('submission.csv',index=False)\n    del train\n    del test\n</code>\nand make error.</p>\n\n<p>This method was used in Instant Gratification.\n<a href=\"https://www.kaggle.com/c/instant-gratification/discussion/94379#latest-546086\">https://www.kaggle.com/c/instant-gratification/discussion/94379#latest-546086</a></p>\n\n<p>2 In this competition, there are about 10 times larger data in the private dataset,\nso we have to wait a long time when we submit to the competition.\n If you just want to check LB score, you better try the method below.</p>\n\n<p>2.1 Save public id_codes data.\nI saved it with .npy file. \n<a href=\"https://www.kaggle.com/bluexleoxgreen/aptos2019-test\">https://www.kaggle.com/bluexleoxgreen/aptos2019-test</a></p>\n\n<p>2.2 Load the data in your kernel.\n<code>\nid_codes = np.load('../input/aptos2019-test/small_id_codes.npy', allow_pickle = True)\nsmall_ids_df = pd.DataFrame(id_codes, columns=[\"id_code\"])\n</code></p>\n\n<p>2.3 Predict public test data.</p>\n\n<p>2.4 Merge it to the whole test.csv which you can refer from your kernel.\n<code>\ntest_df = pd.read_csv(\"../input/aptos2019-blindness-detection/test.csv\")\nsample_df = small_ids_df\nsample_df[\"diagnosis\"] = test_preds\nsub = pd.merge(test_df, sample_df, on='id_code', how='left').fillna(0)\nsub[\"diagnosis\"] = sub[\"diagnosis\"].astype(int)\nsub.to_csv(\"submission.csv\", index=False)\n</code>\nSince you can save your prediction model in your kernel, this method will help you to keep the reproducibility.</p>\n\n<p>Note that this method doesn't predict the private dataset.\nDon't use it for your final submission. </p>",
  "messages": [
    {
      "id": "569750",
      "postDate": "07/07/2019 08:58:44",
      "content": "<p>We can make the submit cycle faster with 2 points.</p>\n\n<p>1 You can make the submit phase faster with this method.\nCheck the data length of \"sample_submission.csv\" or \"test.csv\" like\n<code>\nsub = pd.read_csv('../input/sample_submission.csv') <br>\nif len(sub) &amp;lt; 2000:\n    sub.to_csv('submission.csv',index=False)\n    del train\n    del test\n</code>\nand make error.</p>\n\n<p>This method was used in Instant Gratification.\n<a href=\"https://www.kaggle.com/c/instant-gratification/discussion/94379#latest-546086\">https://www.kaggle.com/c/instant-gratification/discussion/94379#latest-546086</a></p>\n\n<p>2 In this competition, there are about 10 times larger data in the private dataset,\nso we have to wait a long time when we submit to the competition.\n If you just want to check LB score, you better try the method below.</p>\n\n<p>2.1 Save public id_codes data.\nI saved it with .npy file. \n<a href=\"https://www.kaggle.com/bluexleoxgreen/aptos2019-test\">https://www.kaggle.com/bluexleoxgreen/aptos2019-test</a></p>\n\n<p>2.2 Load the data in your kernel.\n<code>\nid_codes = np.load('../input/aptos2019-test/small_id_codes.npy', allow_pickle = True)\nsmall_ids_df = pd.DataFrame(id_codes, columns=[\"id_code\"])\n</code></p>\n\n<p>2.3 Predict public test data.</p>\n\n<p>2.4 Merge it to the whole test.csv which you can refer from your kernel.\n<code>\ntest_df = pd.read_csv(\"../input/aptos2019-blindness-detection/test.csv\")\nsample_df = small_ids_df\nsample_df[\"diagnosis\"] = test_preds\nsub = pd.merge(test_df, sample_df, on='id_code', how='left').fillna(0)\nsub[\"diagnosis\"] = sub[\"diagnosis\"].astype(int)\nsub.to_csv(\"submission.csv\", index=False)\n</code>\nSince you can save your prediction model in your kernel, this method will help you to keep the reproducibility.</p>\n\n<p>Note that this method doesn't predict the private dataset.\nDon't use it for your final submission. </p>",
      "rawMarkdown": "We can make the submit cycle faster with 2 points.\n\n1 You can make the submit phase faster with this method.\nCheck the data length of \"sample_submission.csv\" or \"test.csv\" like\n```\nsub = pd.read_csv('../input/sample_submission.csv')  \nif len(sub) &lt; 2000:\n    sub.to_csv('submission.csv',index=False)\n    del train\n    del test\n```\nand make error.\n\nThis method was used in Instant Gratification.\nhttps://www.kaggle.com/c/instant-gratification/discussion/94379#latest-546086\n\n2 In this competition, there are about 10 times larger data in the private dataset,\nso we have to wait a long time when we submit to the competition.\n If you just want to check LB score, you better try the method below.\n\n2.1 Save public id_codes data.\nI saved it with .npy file. \nhttps://www.kaggle.com/bluexleoxgreen/aptos2019-test\n\n2.2 Load the data in your kernel.\n```\nid_codes = np.load('../input/aptos2019-test/small_id_codes.npy', allow_pickle = True)\nsmall_ids_df = pd.DataFrame(id_codes, columns=[\"id_code\"])\n```\n\n2.3 Predict public test data.\n\n2.4 Merge it to the whole test.csv which you can refer from your kernel.\n```\ntest_df = pd.read_csv(\"../input/aptos2019-blindness-detection/test.csv\")\nsample_df = small_ids_df\nsample_df[\"diagnosis\"] = test_preds\nsub = pd.merge(test_df, sample_df, on='id_code', how='left').fillna(0)\nsub[\"diagnosis\"] = sub[\"diagnosis\"].astype(int)\nsub.to_csv(\"submission.csv\", index=False)\n```\nSince you can save your prediction model in your kernel, this method will help you to keep the reproducibility.\n\nNote that this method doesn't predict the private dataset.\nDon't use it for your final submission.",
      "votes": null
    },
    {
      "id": "571080",
      "postDate": "07/09/2019 06:22:03",
      "content": "<p>I think the second method is very good. But An error occurred in a specific case, so I will share it.  </p>\n\n<p>When added new data to Private Dataset, I was able to load it with the kernel, but it  did not display on Workspace.\n<img src=\"https://cdn.discordapp.com/attachments/507208726864855060/598032937816162315/AwesomeScreenshot-Fork-of-test-predict-resnet7-2-Kaggle-2019-07-09-15-07-99.png\" alt=\"\">\n<img src=\"https://cdn.discordapp.com/attachments/507208726864855060/598033017914523648/AwesomeScreenshot-Fork-of-test-predict-resnet7-2-Kaggle-2019-07-09-15-07-49.png\" alt=\"\"></p>\n\n<p>This is an example 'resnet 7_3.npy' was not display on Workspace.  And when I submitted, an 'Submission CSV Not Found' error occurs.</p>\n\n<p>In this case, removing and reloading the Pryvate Dataset prevented the occurrence of the error.</p>",
      "rawMarkdown": "I think the second method is very good. But An error occurred in a specific case, so I will share it.  \n\n\nWhen added new data to Private Dataset, I was able to load it with the kernel, but it  did not display on Workspace.\n![](https://cdn.discordapp.com/attachments/507208726864855060/598032937816162315/AwesomeScreenshot-Fork-of-test-predict-resnet7-2-Kaggle-2019-07-09-15-07-99.png)\n![](https://cdn.discordapp.com/attachments/507208726864855060/598033017914523648/AwesomeScreenshot-Fork-of-test-predict-resnet7-2-Kaggle-2019-07-09-15-07-49.png)\n\nThis is an example 'resnet 7_3.npy' was not display on Workspace.  And when I submitted, an 'Submission CSV Not Found' error occurs.\n\nIn this case, removing and reloading the Pryvate Dataset prevented the occurrence of the error.",
      "votes": null
    },
    {
      "id": "571138",
      "postDate": "07/09/2019 08:04:26",
      "content": "<p>Thank you for sharing!\nIn that case, can you read \"resnet7_3.npy\" file when you just commit?</p>",
      "rawMarkdown": "Thank you for sharing!\nIn that case, can you read \"resnet7_3.npy\" file when you just commit?",
      "votes": null
    },
    {
      "id": "571189",
      "postDate": "07/09/2019 09:26:13",
      "content": "<p>When I commit,  can read 'resnet7_3npy' and press the <code>submit to competition</code> button.  </p>\n\n<p>The difference from the previous submission is only <code>np.load(\"../input/aptostest/resnet7_2.npy\")</code> and <code>np.load(\"../input/aptostest/resnet7_3.npy\")</code>.\nI guess that in the private calculation, 'resnet_3.npy' that I added was not read.</p>",
      "rawMarkdown": "When I commit,  can read 'resnet7_3npy' and press the `submit to competition` button.  \n\nThe difference from the previous submission is only `np.load(\"../input/aptostest/resnet7_2.npy\")` and `np.load(\"../input/aptostest/resnet7_3.npy\")`.\nI guess that in the private calculation, 'resnet_3.npy' that I added was not read.",
      "votes": null
    },
    {
      "id": "571198",
      "postDate": "07/09/2019 09:41:31",
      "content": "<p>The following 1 to 5 are the steps I did.</p>\n\n<ol>\n<li>Create Private Dataset and add <code>small_id_codes.npy</code> and <code>resnet7.npy</code> and <code>resnet7_2.npy</code></li>\n<li>Submit 'resnet7.npy' and 'resnet7_2.npy' as the target. No error occurred.</li>\n<li>Add 'resnet7_3.npy to First Private Dataset.</li>\n<li>Fork Second kernels and commit 'resnet7_3.npy' as the target . <code>Submission CSV Not Found</code> error occurs.</li>\n<li>Edit 4. kernels, and delete and and reloading the Pryvate Dataset. This is successful.</li>\n</ol>",
      "rawMarkdown": "The following 1 to 5 are the steps I did.\n\n1. Create Private Dataset and add `small_id_codes.npy` and `resnet7.npy` and `resnet7_2.npy`\n2. Submit 'resnet7.npy' and 'resnet7_2.npy' as the target. No error occurred.\n3. Add 'resnet7_3.npy to First Private Dataset.\n4. Fork Second kernels and commit 'resnet7_3.npy' as the target . `Submission CSV Not Found` error occurs.\n5. Edit 4. kernels, and delete and and reloading the Pryvate Dataset. This is successful.",
      "votes": null
    },
    {
      "id": "574594",
      "postDate": "07/14/2019 06:37:22",
      "content": "<p>My way to do the first method for notebook by adding these script to the first cell:\n```python\nimport pandas as pd\ntry:\n    sub = pd.read_csv('../input/aptos2019-blindness-detection/sample_submission.csv')\nexcept:\n    sub = pd.read_csv('../input/sample_submission.csv')</p>\n\n<p>if len(sub) &lt; 2000:\n    sub.to_csv('submission.csv',index=False)\n    exit()\n```\nReference to this <a href=\"https://www.kaggle.com/c/instant-gratification/discussion/94379#latest-546086\">https://www.kaggle.com/c/instant-gratification/discussion/94379#latest-546086</a> .\nThis way it is faster.  But you can choose use less training data, so the commit session will help to check if your code has logic error or something.</p>",
      "rawMarkdown": "My way to do the first method for notebook by adding these script to the first cell:\n```python\nimport pandas as pd\ntry:\n    sub = pd.read_csv('../input/aptos2019-blindness-detection/sample_submission.csv')\nexcept:\n    sub = pd.read_csv('../input/sample_submission.csv')\n\nif len(sub) &lt; 2000:\n    sub.to_csv('submission.csv',index=False)\n    exit()\n```\nReference to this https://www.kaggle.com/c/instant-gratification/discussion/94379#latest-546086 .\nThis way it is faster.  But you can choose use less training data, so the commit session will help to check if your code has logic error or something.",
      "votes": null
    },
    {
      "id": "581570",
      "postDate": "07/22/2019 05:51:44",
      "content": "<p>I couldn't get the 2nd method to work. It tells me Submission Error.</p>",
      "rawMarkdown": "I couldn't get the 2nd method to work. It tells me Submission Error.",
      "votes": null
    },
    {
      "id": "581574",
      "postDate": "07/22/2019 06:00:11",
      "content": "<p>The code runs fine when I commit. Everything is good. Submission file is created perfectly. When I submit, it gives error. :S </p>",
      "rawMarkdown": "The code runs fine when I commit. Everything is good. Submission file is created perfectly. When I submit, it gives error. :S",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 571080,
      "author_name": "currypurin",
      "author_url": "",
      "post_date": "07/09/2019 06:22:03",
      "content": "<p>I think the second method is very good. But An error occurred in a specific case, so I will share it.  </p>\n\n<p>When added new data to Private Dataset, I was able to load it with the kernel, but it  did not display on Workspace.\n<img src=\"https://cdn.discordapp.com/attachments/507208726864855060/598032937816162315/AwesomeScreenshot-Fork-of-test-predict-resnet7-2-Kaggle-2019-07-09-15-07-99.png\" alt=\"\">\n<img src=\"https://cdn.discordapp.com/attachments/507208726864855060/598033017914523648/AwesomeScreenshot-Fork-of-test-predict-resnet7-2-Kaggle-2019-07-09-15-07-49.png\" alt=\"\"></p>\n\n<p>This is an example 'resnet 7_3.npy' was not display on Workspace.  And when I submitted, an 'Submission CSV Not Found' error occurs.</p>\n\n<p>In this case, removing and reloading the Pryvate Dataset prevented the occurrence of the error.</p>",
      "votes": null,
      "replies": [
        {
          "id": 571138,
          "author_name": "bluexleoxgreen",
          "author_url": "",
          "post_date": "07/09/2019 08:04:26",
          "content": "<p>Thank you for sharing!\nIn that case, can you read \"resnet7_3.npy\" file when you just commit?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 571189,
          "author_name": "currypurin",
          "author_url": "",
          "post_date": "07/09/2019 09:26:13",
          "content": "<p>When I commit,  can read 'resnet7_3npy' and press the <code>submit to competition</code> button.  </p>\n\n<p>The difference from the previous submission is only <code>np.load(\"../input/aptostest/resnet7_2.npy\")</code> and <code>np.load(\"../input/aptostest/resnet7_3.npy\")</code>.\nI guess that in the private calculation, 'resnet_3.npy' that I added was not read.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 571198,
          "author_name": "currypurin",
          "author_url": "",
          "post_date": "07/09/2019 09:41:31",
          "content": "<p>The following 1 to 5 are the steps I did.</p>\n\n<ol>\n<li>Create Private Dataset and add <code>small_id_codes.npy</code> and <code>resnet7.npy</code> and <code>resnet7_2.npy</code></li>\n<li>Submit 'resnet7.npy' and 'resnet7_2.npy' as the target. No error occurred.</li>\n<li>Add 'resnet7_3.npy to First Private Dataset.</li>\n<li>Fork Second kernels and commit 'resnet7_3.npy' as the target . <code>Submission CSV Not Found</code> error occurs.</li>\n<li>Edit 4. kernels, and delete and and reloading the Pryvate Dataset. This is successful.</li>\n</ol>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 574594,
      "author_name": "k1gaggle",
      "author_url": "",
      "post_date": "07/14/2019 06:37:22",
      "content": "<p>My way to do the first method for notebook by adding these script to the first cell:\n```python\nimport pandas as pd\ntry:\n    sub = pd.read_csv('../input/aptos2019-blindness-detection/sample_submission.csv')\nexcept:\n    sub = pd.read_csv('../input/sample_submission.csv')</p>\n\n<p>if len(sub) &lt; 2000:\n    sub.to_csv('submission.csv',index=False)\n    exit()\n```\nReference to this <a href=\"https://www.kaggle.com/c/instant-gratification/discussion/94379#latest-546086\">https://www.kaggle.com/c/instant-gratification/discussion/94379#latest-546086</a> .\nThis way it is faster.  But you can choose use less training data, so the commit session will help to check if your code has logic error or something.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 581570,
      "author_name": "yousof9",
      "author_url": "",
      "post_date": "07/22/2019 05:51:44",
      "content": "<p>I couldn't get the 2nd method to work. It tells me Submission Error.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 581574,
      "author_name": "yousof9",
      "author_url": "",
      "post_date": "07/22/2019 06:00:11",
      "content": "<p>The code runs fine when I commit. Everything is good. Submission file is created perfectly. When I submit, it gives error. :S </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "569750": "We can make the submit cycle faster with 2 points.\n\n1 You can make the submit phase faster with this method.\nCheck the data length of \"sample_submission.csv\" or \"test.csv\" like\n```\nsub = pd.read_csv('../input/sample_submission.csv')  \nif len(sub) &lt; 2000:\n    sub.to_csv('submission.csv',index=False)\n    del train\n    del test\n```\nand make error.\n\nThis method was used in Instant Gratification.\nhttps://www.kaggle.com/c/instant-gratification/discussion/94379#latest-546086\n\n2 In this competition, there are about 10 times larger data in the private dataset,\nso we have to wait a long time when we submit to the competition.\n If you just want to check LB score, you better try the method below.\n\n2.1 Save public id_codes data.\nI saved it with .npy file. \nhttps://www.kaggle.com/bluexleoxgreen/aptos2019-test\n\n2.2 Load the data in your kernel.\n```\nid_codes = np.load('../input/aptos2019-test/small_id_codes.npy', allow_pickle = True)\nsmall_ids_df = pd.DataFrame(id_codes, columns=[\"id_code\"])\n```\n\n2.3 Predict public test data.\n\n2.4 Merge it to the whole test.csv which you can refer from your kernel.\n```\ntest_df = pd.read_csv(\"../input/aptos2019-blindness-detection/test.csv\")\nsample_df = small_ids_df\nsample_df[\"diagnosis\"] = test_preds\nsub = pd.merge(test_df, sample_df, on='id_code', how='left').fillna(0)\nsub[\"diagnosis\"] = sub[\"diagnosis\"].astype(int)\nsub.to_csv(\"submission.csv\", index=False)\n```\nSince you can save your prediction model in your kernel, this method will help you to keep the reproducibility.\n\nNote that this method doesn't predict the private dataset.\nDon't use it for your final submission.",
    "571080": "I think the second method is very good. But An error occurred in a specific case, so I will share it.  \n\n\nWhen added new data to Private Dataset, I was able to load it with the kernel, but it  did not display on Workspace.\n![](https://cdn.discordapp.com/attachments/507208726864855060/598032937816162315/AwesomeScreenshot-Fork-of-test-predict-resnet7-2-Kaggle-2019-07-09-15-07-99.png)\n![](https://cdn.discordapp.com/attachments/507208726864855060/598033017914523648/AwesomeScreenshot-Fork-of-test-predict-resnet7-2-Kaggle-2019-07-09-15-07-49.png)\n\nThis is an example 'resnet 7_3.npy' was not display on Workspace.  And when I submitted, an 'Submission CSV Not Found' error occurs.\n\nIn this case, removing and reloading the Pryvate Dataset prevented the occurrence of the error.",
    "571138": "Thank you for sharing!\nIn that case, can you read \"resnet7_3.npy\" file when you just commit?",
    "571189": "When I commit,  can read 'resnet7_3npy' and press the `submit to competition` button.  \n\nThe difference from the previous submission is only `np.load(\"../input/aptostest/resnet7_2.npy\")` and `np.load(\"../input/aptostest/resnet7_3.npy\")`.\nI guess that in the private calculation, 'resnet_3.npy' that I added was not read.",
    "571198": "The following 1 to 5 are the steps I did.\n\n1. Create Private Dataset and add `small_id_codes.npy` and `resnet7.npy` and `resnet7_2.npy`\n2. Submit 'resnet7.npy' and 'resnet7_2.npy' as the target. No error occurred.\n3. Add 'resnet7_3.npy to First Private Dataset.\n4. Fork Second kernels and commit 'resnet7_3.npy' as the target . `Submission CSV Not Found` error occurs.\n5. Edit 4. kernels, and delete and and reloading the Pryvate Dataset. This is successful.",
    "574594": "My way to do the first method for notebook by adding these script to the first cell:\n```python\nimport pandas as pd\ntry:\n    sub = pd.read_csv('../input/aptos2019-blindness-detection/sample_submission.csv')\nexcept:\n    sub = pd.read_csv('../input/sample_submission.csv')\n\nif len(sub) &lt; 2000:\n    sub.to_csv('submission.csv',index=False)\n    exit()\n```\nReference to this https://www.kaggle.com/c/instant-gratification/discussion/94379#latest-546086 .\nThis way it is faster.  But you can choose use less training data, so the commit session will help to check if your code has logic error or something.",
    "581570": "I couldn't get the 2nd method to work. It tells me Submission Error.",
    "581574": "The code runs fine when I commit. Everything is good. Submission file is created perfectly. When I submit, it gives error. :S"
  },
  "source": "meta"
}