{
  "id": 238403,
  "title": "validation and the domain gap",
  "url": "/competitions/birdclef-2021/discussion/238403",
  "author_name": "",
  "post_date": "2021-05-12T06:08:07.358260800Z",
  "votes": 4,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Hi all,</p>\n<p>This is probably obvious to most of you but I'm struggling to understand some basic things about validation and the domain gap between the training data and the test data.</p>\n<p>Given the  domain gap, what should I be using as the validation set while training? A part of my (augmented, transformed…) training set, or the provided soundscapes ?</p>\n<p>If the former: doesn't this always lead to overfitting? </p>\n<p>If the latter, what is the use of k-fold cross validation, since I will be using all training material that I can generate anyway? (Maybe I misunderstand CV…) </p>\n<p>Thank you all.</p>",
  "messages": [
    {
      "id": "1303547",
      "postDate": "05/12/2021 06:08:07",
      "content": "<p>Hi all,</p>\n<p>This is probably obvious to most of you but I'm struggling to understand some basic things about validation and the domain gap between the training data and the test data.</p>\n<p>Given the  domain gap, what should I be using as the validation set while training? A part of my (augmented, transformed…) training set, or the provided soundscapes ?</p>\n<p>If the former: doesn't this always lead to overfitting? </p>\n<p>If the latter, what is the use of k-fold cross validation, since I will be using all training material that I can generate anyway? (Maybe I misunderstand CV…) </p>\n<p>Thank you all.</p>",
      "rawMarkdown": "Hi all,\n\nThis is probably obvious to most of you but I'm struggling to understand some basic things about validation and the domain gap between the training data and the test data.\n\nGiven the  domain gap, what should I be using as the validation set while training? A part of my (augmented, transformed...) training set, or the provided soundscapes ?\n\nIf the former: doesn't this always lead to overfitting? \n\nIf the latter, what is the use of k-fold cross validation, since I will be using all training material that I can generate anyway? (Maybe I misunderstand CV...) \n\nThank you all.",
      "votes": null
    },
    {
      "id": "1304029",
      "postDate": "05/12/2021 11:42:20",
      "content": "<p>You can use any part of dataset as your validation set until you do not train it. <br>\nAs in this competition we are provided with train_short_audios and train_soundscapes many of the competitors are using the train_short_audios to train and then test the performance on train_soundscapes to decide if the model is good enough of or not. The performance on train_soundscapes is being considered as CV…</p>",
      "rawMarkdown": "You can use any part of dataset as your validation set until you do not train it. \nAs in this competition we are provided with train_short_audios and train_soundscapes many of the competitors are using the train_short_audios to train and then test the performance on train_soundscapes to decide if the model is good enough of or not. The performance on train_soundscapes is being considered as CV...",
      "votes": null
    },
    {
      "id": "1304169",
      "postDate": "05/12/2021 13:17:48",
      "content": "<p><a href=\"https://www.kaggle.com/nitindatta\" target=\"_blank\">@nitindatta</a> Thank you for your answer.                                                                                                                                                                                                                                                    </p>\n<p>Could you advise if my approach makes sense.                                                                                                                                                                                                                                              </p>\n<p>My dataloaders generate spectrograms on the fly from randomly selected and augmented signals.                                                                                                                                                                                             <br>\nAfter each epoch I 'validate' against the train_soundscapes.                                                                                                                                                                                                                              <br>\nSo, not against some fixed hold out set generated in the same way as (but not used by) the training set.                                                                                                                                                                                  <br>\nTherefore no folding or anything, which a lot of people seem to be using.                                                                                                                                                                                                                 </p>\n<p>Does that make sense?<br>\nThank you.</p>",
      "rawMarkdown": "nitindatta Thank you for your answer.                                                                                                                                                                                                                                                    \n                                                                                                                                                                                                                                                                                          \nCould you advise if my approach makes sense.                                                                                                                                                                                                                                              \n                                                                                                                                                                                                                                                                                          \nMy dataloaders generate spectrograms on the fly from randomly selected and augmented signals.                                                                                                                                                                                             \nAfter each epoch I 'validate' against the train_soundscapes.                                                                                                                                                                                                                              \nSo, not against some fixed hold out set generated in the same way as (but not used by) the training set.                                                                                                                                                                                  \nTherefore no folding or anything, which a lot of people seem to be using.                                                                                                                                                                                                                 \n                                                                                                                                                                                                                                                                                          \nDoes that make sense?\nThank you.",
      "votes": null
    },
    {
      "id": "1304439",
      "postDate": "05/12/2021 16:09:28",
      "content": "<p>train_short_audio -&gt; split into n-folds -&gt; keep one fold for validation and train on rest</p>\n<p>trained_model -&gt; check F1 score on train_soundscapes….. </p>\n<p>I hope this gives you a clear idea</p>",
      "rawMarkdown": "train_short_audio -> split into n-folds -> keep one fold for validation and train on rest\n\ntrained_model -> check F1 score on train_soundscapes..... \n\nI hope this gives you a clear idea",
      "votes": null
    },
    {
      "id": "1304491",
      "postDate": "05/12/2021 16:45:27",
      "content": "<p>Thank you once more.<br>\nIt's still not clear to me however, why you need a hold out/validation set based on the training data, given the domain shift between the training data and the test data.</p>",
      "rawMarkdown": "Thank you once more.\nIt's still not clear to me however, why you need a hold out/validation set based on the training data, given the domain shift between the training data and the test data.",
      "votes": null
    },
    {
      "id": "1304558",
      "postDate": "05/12/2021 17:40:36",
      "content": "<p>You don't need a validation set. Depends on your approach. Some approaches may use the validation sets for stacking/blending. Some may use validation set to select hyper-parameters. Alternatively, you can use LB as feedback to select hyper-parameters, but you risk overfitting to LB.</p>",
      "rawMarkdown": "You don't need a validation set. Depends on your approach. Some approaches may use the validation sets for stacking/blending. Some may use validation set to select hyper-parameters. Alternatively, you can use LB as feedback to select hyper-parameters, but you risk overfitting to LB.",
      "votes": null
    },
    {
      "id": "1304578",
      "postDate": "05/12/2021 17:52:11",
      "content": "<p><a href=\"https://www.kaggle.com/jy2tong\" target=\"_blank\">@jy2tong</a> Thank you. That's what I thought. But given my dismal score, I thought I'd ask.</p>",
      "rawMarkdown": "jy2tong Thank you. That's what I thought. But given my dismal score, I thought I'd ask.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1304029,
      "author_name": "nitindatta",
      "author_url": "",
      "post_date": "05/12/2021 11:42:20",
      "content": "<p>You can use any part of dataset as your validation set until you do not train it. <br>\nAs in this competition we are provided with train_short_audios and train_soundscapes many of the competitors are using the train_short_audios to train and then test the performance on train_soundscapes to decide if the model is good enough of or not. The performance on train_soundscapes is being considered as CV…</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1304169,
      "author_name": "botkop",
      "author_url": "",
      "post_date": "05/12/2021 13:17:48",
      "content": "<p><a href=\"https://www.kaggle.com/nitindatta\" target=\"_blank\">@nitindatta</a> Thank you for your answer.                                                                                                                                                                                                                                                    </p>\n<p>Could you advise if my approach makes sense.                                                                                                                                                                                                                                              </p>\n<p>My dataloaders generate spectrograms on the fly from randomly selected and augmented signals.                                                                                                                                                                                             <br>\nAfter each epoch I 'validate' against the train_soundscapes.                                                                                                                                                                                                                              <br>\nSo, not against some fixed hold out set generated in the same way as (but not used by) the training set.                                                                                                                                                                                  <br>\nTherefore no folding or anything, which a lot of people seem to be using.                                                                                                                                                                                                                 </p>\n<p>Does that make sense?<br>\nThank you.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1304439,
          "author_name": "nitindatta",
          "author_url": "",
          "post_date": "05/12/2021 16:09:28",
          "content": "<p>train_short_audio -&gt; split into n-folds -&gt; keep one fold for validation and train on rest</p>\n<p>trained_model -&gt; check F1 score on train_soundscapes….. </p>\n<p>I hope this gives you a clear idea</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1304491,
      "author_name": "botkop",
      "author_url": "",
      "post_date": "05/12/2021 16:45:27",
      "content": "<p>Thank you once more.<br>\nIt's still not clear to me however, why you need a hold out/validation set based on the training data, given the domain shift between the training data and the test data.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1304558,
          "author_name": "jy2tong",
          "author_url": "",
          "post_date": "05/12/2021 17:40:36",
          "content": "<p>You don't need a validation set. Depends on your approach. Some approaches may use the validation sets for stacking/blending. Some may use validation set to select hyper-parameters. Alternatively, you can use LB as feedback to select hyper-parameters, but you risk overfitting to LB.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1304578,
      "author_name": "botkop",
      "author_url": "",
      "post_date": "05/12/2021 17:52:11",
      "content": "<p><a href=\"https://www.kaggle.com/jy2tong\" target=\"_blank\">@jy2tong</a> Thank you. That's what I thought. But given my dismal score, I thought I'd ask.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1303547": "Hi all,\n\nThis is probably obvious to most of you but I'm struggling to understand some basic things about validation and the domain gap between the training data and the test data.\n\nGiven the  domain gap, what should I be using as the validation set while training? A part of my (augmented, transformed...) training set, or the provided soundscapes ?\n\nIf the former: doesn't this always lead to overfitting? \n\nIf the latter, what is the use of k-fold cross validation, since I will be using all training material that I can generate anyway? (Maybe I misunderstand CV...) \n\nThank you all.",
    "1304029": "You can use any part of dataset as your validation set until you do not train it. \nAs in this competition we are provided with train_short_audios and train_soundscapes many of the competitors are using the train_short_audios to train and then test the performance on train_soundscapes to decide if the model is good enough of or not. The performance on train_soundscapes is being considered as CV...",
    "1304169": "nitindatta Thank you for your answer.                                                                                                                                                                                                                                                    \n                                                                                                                                                                                                                                                                                          \nCould you advise if my approach makes sense.                                                                                                                                                                                                                                              \n                                                                                                                                                                                                                                                                                          \nMy dataloaders generate spectrograms on the fly from randomly selected and augmented signals.                                                                                                                                                                                             \nAfter each epoch I 'validate' against the train_soundscapes.                                                                                                                                                                                                                              \nSo, not against some fixed hold out set generated in the same way as (but not used by) the training set.                                                                                                                                                                                  \nTherefore no folding or anything, which a lot of people seem to be using.                                                                                                                                                                                                                 \n                                                                                                                                                                                                                                                                                          \nDoes that make sense?\nThank you.",
    "1304439": "train_short_audio -> split into n-folds -> keep one fold for validation and train on rest\n\ntrained_model -> check F1 score on train_soundscapes..... \n\nI hope this gives you a clear idea",
    "1304491": "Thank you once more.\nIt's still not clear to me however, why you need a hold out/validation set based on the training data, given the domain shift between the training data and the test data.",
    "1304558": "You don't need a validation set. Depends on your approach. Some approaches may use the validation sets for stacking/blending. Some may use validation set to select hyper-parameters. Alternatively, you can use LB as feedback to select hyper-parameters, but you risk overfitting to LB.",
    "1304578": "jy2tong Thank you. That's what I thought. But given my dismal score, I thought I'd ask."
  },
  "source": "meta"
}