{
  "id": 547316,
  "title": "FYI: Set different behaviour in submission runs",
  "url": "/competitions/czii-cryo-et-object-identification/discussion/547316",
  "author_name": "",
  "post_date": "2024-11-20T19:40:14.391648900Z",
  "votes": 7,
  "comment_count": 1,
  "views": 0,
  "content": "<p>This is just because I only learned this today and some people might not know: </p>\n<p>You can change the behavior of the code in your notebook when running as a submission by checking the <code>KAGGLE_IS_COMPETITION_RERUN</code> environmental variable: </p>\n<pre><code> os.getenv():\n    # Rerun-specific \nelse:\n    # Non-rerun \n</code></pre>\n<p>This is useful if you e.g. want to perform your cross validation when running the notebook without submitting, and then not perform cross-validation when actually submitting. </p>\n<p>I did that in <a href=\"https://www.kaggle.com/code/fnands/baseline-unet-train-submit\" target=\"_blank\">my notebook </a> (which uses CV code I blatantly \"borrowed\" from <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> )</p>\n<p>The dev announcement is <a href=\"https://www.kaggle.com/discussions/product-feedback/315792\" target=\"_blank\">here</a>. </p>",
  "messages": [
    {
      "id": "3051058",
      "postDate": "11/20/2024 19:40:14",
      "content": "<p>This is just because I only learned this today and some people might not know: </p>\n<p>You can change the behavior of the code in your notebook when running as a submission by checking the <code>KAGGLE_IS_COMPETITION_RERUN</code> environmental variable: </p>\n<pre><code> os.getenv():\n    # Rerun-specific \nelse:\n    # Non-rerun \n</code></pre>\n<p>This is useful if you e.g. want to perform your cross validation when running the notebook without submitting, and then not perform cross-validation when actually submitting. </p>\n<p>I did that in <a href=\"https://www.kaggle.com/code/fnands/baseline-unet-train-submit\" target=\"_blank\">my notebook </a> (which uses CV code I blatantly \"borrowed\" from <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> )</p>\n<p>The dev announcement is <a href=\"https://www.kaggle.com/discussions/product-feedback/315792\" target=\"_blank\">here</a>. </p>",
      "rawMarkdown": "This is just because I only learned this today and some people might not know: \n\nYou can change the behavior of the code in your notebook when running as a submission by checking the `KAGGLE_IS_COMPETITION_RERUN` environmental variable: \n\n```\nif os.getenv('KAGGLE_IS_COMPETITION_RERUN'):\n    # Rerun-specific code\nelse:\n    # Non-rerun code\n```\n\nThis is useful if you e.g. want to perform your cross validation when running the notebook without submitting, and then not perform cross-validation when actually submitting. \n\nI did that in [my notebook ](https://www.kaggle.com/code/fnands/baseline-unet-train-submit) (which uses CV code I blatantly \"borrowed\" from @hengck23 )\n\nThe dev announcement is [here](https://www.kaggle.com/discussions/product-feedback/315792).",
      "votes": null
    },
    {
      "id": "3051189",
      "postDate": "11/21/2024 01:39:44",
      "content": "<p>Cool!  I always set a boolean that I changed, but this is better.</p>",
      "rawMarkdown": "Cool!  I always set a boolean that I changed, but this is better.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3051189,
      "author_name": "davidlist",
      "author_url": "",
      "post_date": "11/21/2024 01:39:44",
      "content": "<p>Cool!  I always set a boolean that I changed, but this is better.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3051058": "This is just because I only learned this today and some people might not know: \n\nYou can change the behavior of the code in your notebook when running as a submission by checking the `KAGGLE_IS_COMPETITION_RERUN` environmental variable: \n\n```\nif os.getenv('KAGGLE_IS_COMPETITION_RERUN'):\n    # Rerun-specific code\nelse:\n    # Non-rerun code\n```\n\nThis is useful if you e.g. want to perform your cross validation when running the notebook without submitting, and then not perform cross-validation when actually submitting. \n\nI did that in [my notebook ](https://www.kaggle.com/code/fnands/baseline-unet-train-submit) (which uses CV code I blatantly \"borrowed\" from @hengck23 )\n\nThe dev announcement is [here](https://www.kaggle.com/discussions/product-feedback/315792).",
    "3051189": "Cool!  I always set a boolean that I changed, but this is better."
  },
  "source": "meta"
}