{
  "id": 443027,
  "title": "Why no CV in public notebook",
  "url": "/competitions/child-mind-institute-detect-sleep-states/discussion/443027",
  "author_name": "",
  "post_date": "2023-09-25T08:57:14.490753500Z",
  "votes": 9,
  "comment_count": 8,
  "views": 0,
  "content": "<p>I am really curious why most public notebook is not doing any cross validation and only making one model with some (maybe) tuned hyper parameter, are they doing the CV in the background and publishing the notebook with best hyper parameter?</p>",
  "messages": [
    {
      "id": "2455017",
      "postDate": "09/25/2023 08:57:14",
      "content": "<p>I am really curious why most public notebook is not doing any cross validation and only making one model with some (maybe) tuned hyper parameter, are they doing the CV in the background and publishing the notebook with best hyper parameter?</p>",
      "rawMarkdown": "I am really curious why most public notebook is not doing any cross validation and only making one model with some (maybe) tuned hyper parameter, are they doing the CV in the background and publishing the notebook with best hyper parameter?",
      "votes": null
    },
    {
      "id": "2455024",
      "postDate": "09/25/2023 09:05:54",
      "content": "<p>Possibly the use of public notebook is only for MVP, i.e. the lowest hanging fruit that  we can develop it further. Implementing CV might take some time that violate this goal.</p>\n<p>Either way, it's good for anyone to start a public notebook with innovations like implementing CV or other methods. It will attract more medals though.</p>",
      "rawMarkdown": "Possibly the use of public notebook is only for MVP, i.e. the lowest hanging fruit that  we can develop it further. Implementing CV might take some time that violate this goal.\n\nEither way, it's good for anyone to start a public notebook with innovations like implementing CV or other methods. It will attract more medals though.",
      "votes": null
    },
    {
      "id": "2455046",
      "postDate": "09/25/2023 09:22:32",
      "content": "<p>wow, yeah, that's true, and think that answered my other question of why they are all using the basic random forest as base model. Thanks!</p>",
      "rawMarkdown": "wow, yeah, that's true, and think that answered my other question of why they are all using the basic random forest as base model. Thanks!",
      "votes": null
    },
    {
      "id": "2455501",
      "postDate": "09/25/2023 14:05:08",
      "content": "<p>Using a CV blows the notebook out of memory and creates issues, hence a no-CV approach is chosen for now <a href=\"https://www.kaggle.com/yuchen2066\" target=\"_blank\">@yuchen2066</a> </p>",
      "rawMarkdown": "Using a CV blows the notebook out of memory and creates issues, hence a no-CV approach is chosen for now @yuchen2066",
      "votes": null
    },
    {
      "id": "2457305",
      "postDate": "09/26/2023 19:18:54",
      "content": "<p>True, I tried CV, and it occasionally also will do <strong>notebook timeout</strong> for submission</p>",
      "rawMarkdown": "True, I tried CV, and it occasionally also will do **notebook timeout** for submission",
      "votes": null
    },
    {
      "id": "2457783",
      "postDate": "09/27/2023 06:53:50",
      "content": "<p>Dear <a href=\"https://www.kaggle.com/yuchen2066\" target=\"_blank\">@yuchen2066</a> </p>\n<p>CV is designed for a local assessment of ones performance. When submitting the notebook one should turn off the local assessment beforehand as it simply becomes a waste of CPU and memory.</p>\n<p>All the best,<br>\ncarl</p>",
      "rawMarkdown": "Dear @yuchen2066 \n\nCV is designed for a local assessment of ones performance. When submitting the notebook one should turn off the local assessment beforehand as it simply becomes a waste of CPU and memory.\n\nAll the best,\ncarl",
      "votes": null
    },
    {
      "id": "2457999",
      "postDate": "09/27/2023 09:19:26",
      "content": "<p>Dear Carl,</p>\n<p>Thank you for your answer. However, I always have the thought of using cross-validation to train multiple models and then averaging their predictions could potentially make the prediction more accurate or robust. Is this correct? and are we not using CV for prediction in this competition to save memory and time, because of the size of test file?</p>\n<p>Thank you!</p>\n<p>Yuchen.</p>",
      "rawMarkdown": "Dear Carl,\n\nThank you for your answer. However, I always have the thought of using cross-validation to train multiple models and then averaging their predictions could potentially make the prediction more accurate or robust. Is this correct? and are we not using CV for prediction in this competition to save memory and time, because of the size of test file?\n\nThank you!\n\nYuchen.",
      "votes": null
    },
    {
      "id": "2458012",
      "postDate": "09/27/2023 09:26:26",
      "content": "<p>Dear <a href=\"https://www.kaggle.com/yuchen2066\" target=\"_blank\">@yuchen2066</a> </p>\n<p>Indeed one could use the OOF predictions from multiple models obtained via a CV loop to then undertake stacking. Given how computationally intense this is I would suggest saving such a model beforehand, and then load the model into a dedicated \"prediction\" notebook (…or for members of the deep learning fraternity, an \"inference\" notebook 😜)</p>\n<p>All the best,<br>\ncarl</p>",
      "rawMarkdown": "Dear @yuchen2066 \n\nIndeed one could use the OOF predictions from multiple models obtained via a CV loop to then undertake stacking. Given how computationally intense this is I would suggest saving such a model beforehand, and then load the model into a dedicated \"prediction\" notebook (...or for members of the deep learning fraternity, an \"inference\" notebook 😜)\n\nAll the best,\ncarl",
      "votes": null
    },
    {
      "id": "2458033",
      "postDate": "09/27/2023 09:40:21",
      "content": "<p>Hahaha 😂, Thanks for confirming. For now, I will stick with just one model. Interestingly, a LightGBM model with 3-fold cross-validation takes only 10 minutes to train, but it seems to require over 9 hours for inference on the test set. By the way, does increasing the \"n-estimators\" parameter in LightGBM significantly slow down the inference process? I suspect this might be the reason for the extended inference time.</p>",
      "rawMarkdown": "Hahaha 😂, Thanks for confirming. For now, I will stick with just one model. Interestingly, a LightGBM model with 3-fold cross-validation takes only 10 minutes to train, but it seems to require over 9 hours for inference on the test set. By the way, does increasing the \"n-estimators\" parameter in LightGBM significantly slow down the inference process? I suspect this might be the reason for the extended inference time.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2455024,
      "author_name": "rimbax",
      "author_url": "",
      "post_date": "09/25/2023 09:05:54",
      "content": "<p>Possibly the use of public notebook is only for MVP, i.e. the lowest hanging fruit that  we can develop it further. Implementing CV might take some time that violate this goal.</p>\n<p>Either way, it's good for anyone to start a public notebook with innovations like implementing CV or other methods. It will attract more medals though.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2455046,
          "author_name": "yuchen2066",
          "author_url": "",
          "post_date": "09/25/2023 09:22:32",
          "content": "<p>wow, yeah, that's true, and think that answered my other question of why they are all using the basic random forest as base model. Thanks!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2455501,
      "author_name": "ravi20076",
      "author_url": "",
      "post_date": "09/25/2023 14:05:08",
      "content": "<p>Using a CV blows the notebook out of memory and creates issues, hence a no-CV approach is chosen for now <a href=\"https://www.kaggle.com/yuchen2066\" target=\"_blank\">@yuchen2066</a> </p>",
      "votes": null,
      "replies": [
        {
          "id": 2457305,
          "author_name": "yuchen2066",
          "author_url": "",
          "post_date": "09/26/2023 19:18:54",
          "content": "<p>True, I tried CV, and it occasionally also will do <strong>notebook timeout</strong> for submission</p>",
          "votes": null,
          "replies": [
            {
              "id": 2457783,
              "author_name": "carlmcbrideellis",
              "author_url": "",
              "post_date": "09/27/2023 06:53:50",
              "content": "<p>Dear <a href=\"https://www.kaggle.com/yuchen2066\" target=\"_blank\">@yuchen2066</a> </p>\n<p>CV is designed for a local assessment of ones performance. When submitting the notebook one should turn off the local assessment beforehand as it simply becomes a waste of CPU and memory.</p>\n<p>All the best,<br>\ncarl</p>",
              "votes": null,
              "replies": [
                {
                  "id": 2457999,
                  "author_name": "yuchen2066",
                  "author_url": "",
                  "post_date": "09/27/2023 09:19:26",
                  "content": "<p>Dear Carl,</p>\n<p>Thank you for your answer. However, I always have the thought of using cross-validation to train multiple models and then averaging their predictions could potentially make the prediction more accurate or robust. Is this correct? and are we not using CV for prediction in this competition to save memory and time, because of the size of test file?</p>\n<p>Thank you!</p>\n<p>Yuchen.</p>",
                  "votes": null,
                  "replies": [
                    {
                      "id": 2458012,
                      "author_name": "carlmcbrideellis",
                      "author_url": "",
                      "post_date": "09/27/2023 09:26:26",
                      "content": "<p>Dear <a href=\"https://www.kaggle.com/yuchen2066\" target=\"_blank\">@yuchen2066</a> </p>\n<p>Indeed one could use the OOF predictions from multiple models obtained via a CV loop to then undertake stacking. Given how computationally intense this is I would suggest saving such a model beforehand, and then load the model into a dedicated \"prediction\" notebook (…or for members of the deep learning fraternity, an \"inference\" notebook 😜)</p>\n<p>All the best,<br>\ncarl</p>",
                      "votes": null,
                      "replies": [
                        {
                          "id": 2458033,
                          "author_name": "yuchen2066",
                          "author_url": "",
                          "post_date": "09/27/2023 09:40:21",
                          "content": "<p>Hahaha 😂, Thanks for confirming. For now, I will stick with just one model. Interestingly, a LightGBM model with 3-fold cross-validation takes only 10 minutes to train, but it seems to require over 9 hours for inference on the test set. By the way, does increasing the \"n-estimators\" parameter in LightGBM significantly slow down the inference process? I suspect this might be the reason for the extended inference time.</p>",
                          "votes": null,
                          "replies": []
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2455017": "I am really curious why most public notebook is not doing any cross validation and only making one model with some (maybe) tuned hyper parameter, are they doing the CV in the background and publishing the notebook with best hyper parameter?",
    "2455024": "Possibly the use of public notebook is only for MVP, i.e. the lowest hanging fruit that  we can develop it further. Implementing CV might take some time that violate this goal.\n\nEither way, it's good for anyone to start a public notebook with innovations like implementing CV or other methods. It will attract more medals though.",
    "2455046": "wow, yeah, that's true, and think that answered my other question of why they are all using the basic random forest as base model. Thanks!",
    "2455501": "Using a CV blows the notebook out of memory and creates issues, hence a no-CV approach is chosen for now @yuchen2066",
    "2457305": "True, I tried CV, and it occasionally also will do **notebook timeout** for submission",
    "2457783": "Dear @yuchen2066 \n\nCV is designed for a local assessment of ones performance. When submitting the notebook one should turn off the local assessment beforehand as it simply becomes a waste of CPU and memory.\n\nAll the best,\ncarl",
    "2457999": "Dear Carl,\n\nThank you for your answer. However, I always have the thought of using cross-validation to train multiple models and then averaging their predictions could potentially make the prediction more accurate or robust. Is this correct? and are we not using CV for prediction in this competition to save memory and time, because of the size of test file?\n\nThank you!\n\nYuchen.",
    "2458012": "Dear @yuchen2066 \n\nIndeed one could use the OOF predictions from multiple models obtained via a CV loop to then undertake stacking. Given how computationally intense this is I would suggest saving such a model beforehand, and then load the model into a dedicated \"prediction\" notebook (...or for members of the deep learning fraternity, an \"inference\" notebook 😜)\n\nAll the best,\ncarl",
    "2458033": "Hahaha 😂, Thanks for confirming. For now, I will stick with just one model. Interestingly, a LightGBM model with 3-fold cross-validation takes only 10 minutes to train, but it seems to require over 9 hours for inference on the test set. By the way, does increasing the \"n-estimators\" parameter in LightGBM significantly slow down the inference process? I suspect this might be the reason for the extended inference time."
  },
  "source": "meta"
}