{
  "id": 12599,
  "title": "Train on whole dataset after CV ? ",
  "url": "/competitions/datasciencebowl/discussion/12599",
  "author_name": "",
  "post_date": "2015-02-23T22:58:32.273Z",
  "votes": 1,
  "comment_count": 4,
  "views": 2047,
  "content": "<p>Let's say I divided my train set into train and validation. Then I fit&nbsp;a classifier on train, validate on validation set. So what's next ? Do you, guys, use this classifier as is, or you retrain it on the whole train set (train + val) and use this one as your final classifier ?</p>\n<p>I use about 15% of data as validation, but in this task with highly unbalanced classes 15% contains a lot of important information I assume. After I fit a CNN on 85% data how should I fit the whole dataset ? Considering my experience I need to lower the regularization, but still have no rule of thumb how to do it.</p>\n<p>Probably another solution is to divide train set in another way, fit same classifier and blend it with the one which was fit on the first split.</p>\n<p>It will be great if someone shared his strategy about that.</p>",
  "messages": [
    {
      "id": "64791",
      "postDate": "02/23/2015 22:58:32",
      "content": "<p>Let's say I divided my train set into train and validation. Then I fit&nbsp;a classifier on train, validate on validation set. So what's next ? Do you, guys, use this classifier as is, or you retrain it on the whole train set (train + val) and use this one as your final classifier ?</p>\n<p>I use about 15% of data as validation, but in this task with highly unbalanced classes 15% contains a lot of important information I assume. After I fit a CNN on 85% data how should I fit the whole dataset ? Considering my experience I need to lower the regularization, but still have no rule of thumb how to do it.</p>\n<p>Probably another solution is to divide train set in another way, fit same classifier and blend it with the one which was fit on the first split.</p>\n<p>It will be great if someone shared his strategy about that.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64827",
      "postDate": "02/24/2015 22:54:12",
      "content": "<p>I am wondering the same thing, &nbsp;I guess we can just run the model on the whole dataset with the same setting, e.g. learning rate, iterations ... &nbsp;or maybe change learning rate or iterations a little bit?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "64985",
      "postDate": "02/26/2015 19:37:46",
      "content": "<p>Here is my approach, which I think is pretty standard.</p>\n<p>Training set = 60%<br>Valid set = 20 %<br>Test set = 20%</p>\n<p>Step 1: Training on the training set and get a valid score. <br>Choose the model with the best valid score.<br>With this model predict the test set to have a score.</p>\n<p>Step 2: Training on the full data set : &nbsp;Train + Valid + Test &nbsp;</p>\n<p>Step 3: Make predictions and submit. Usually score on the leaderboard is slightly better than score obtained at Step 1</p>\n\n<p>I don't change the parameters&nbsp;because&nbsp;the point of Step 1 is to choose the best parameters&nbsp;using cross validation. If I change them afterward it makes the whole process useless and I could start at Step 3 as well.&nbsp;</p>\n\n<p>In my opinion your claim that you should lower the regularization is very model&nbsp;dependent. Not all models will perform the same when given more data. If your model have a high bias, more data won't do any good.</p>\n<p>One useful trick might be to train your model with different size of dataset to see how it react to more data. This is often useful just to see if your model <strong>needs</strong> more data or not.&nbsp;</p>\n\n<p><a href=\"http://www.holehouse.org/mlclass/10_Advice_for_applying_machine_learning.html\" target=\"_blank\">Here </a>are some advices from&nbsp;Andrew Ng Machine learning course. The section&nbsp;<em><strong>What should you try next?</strong></em> is particularly interesting.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65011",
      "postDate": "02/27/2015 07:30:12",
      "content": "<p>Hello, intesting question.<br>Although I'm not actively competing here this was my strategy from galaxy zoo and Criteo.</p>\n<p>Based on this article from Alex Krizhevsky.</p>\n<p><a href=\"https://code.google.com/p/cuda-convnet/wiki/Methodology\">https://code.google.com/p/cuda-convnet/wiki/Methodology</a></p>\n<p>Train with holout&nbsp;set until no improvement on holdout loss.<br>Remember the loss you are at with the trainset.<br>Then continue training on all data.. until you reach roughly the same loss as you were on the trainset before..<br><a href=\"https://www.kaggle.com/c/galaxy-zoo-the-galaxy-challenge/forums/t/7599/so-what-were-your-approaches/42880#post42880\">Graph</a><br><br>It takes a leap of faith and perhaps it's &quot;old&quot; knowledge..</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "65060",
      "postDate": "02/27/2015 18:48:54",
      "content": "<p>thanks guys for the discussion, really helpful!</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 64827,
      "author_name": "skylibrary",
      "author_url": "",
      "post_date": "02/24/2015 22:54:12",
      "content": "<p>I am wondering the same thing, &nbsp;I guess we can just run the model on the whole dataset with the same setting, e.g. learning rate, iterations ... &nbsp;or maybe change learning rate or iterations a little bit?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 64985,
      "author_name": "alexandrekowalczyk",
      "author_url": "",
      "post_date": "02/26/2015 19:37:46",
      "content": "<p>Here is my approach, which I think is pretty standard.</p>\n<p>Training set = 60%<br>Valid set = 20 %<br>Test set = 20%</p>\n<p>Step 1: Training on the training set and get a valid score. <br>Choose the model with the best valid score.<br>With this model predict the test set to have a score.</p>\n<p>Step 2: Training on the full data set : &nbsp;Train + Valid + Test &nbsp;</p>\n<p>Step 3: Make predictions and submit. Usually score on the leaderboard is slightly better than score obtained at Step 1</p>\n\n<p>I don't change the parameters&nbsp;because&nbsp;the point of Step 1 is to choose the best parameters&nbsp;using cross validation. If I change them afterward it makes the whole process useless and I could start at Step 3 as well.&nbsp;</p>\n\n<p>In my opinion your claim that you should lower the regularization is very model&nbsp;dependent. Not all models will perform the same when given more data. If your model have a high bias, more data won't do any good.</p>\n<p>One useful trick might be to train your model with different size of dataset to see how it react to more data. This is often useful just to see if your model <strong>needs</strong> more data or not.&nbsp;</p>\n\n<p><a href=\"http://www.holehouse.org/mlclass/10_Advice_for_applying_machine_learning.html\" target=\"_blank\">Here </a>are some advices from&nbsp;Andrew Ng Machine learning course. The section&nbsp;<em><strong>What should you try next?</strong></em> is particularly interesting.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65011,
      "author_name": "juliandewit",
      "author_url": "",
      "post_date": "02/27/2015 07:30:12",
      "content": "<p>Hello, intesting question.<br>Although I'm not actively competing here this was my strategy from galaxy zoo and Criteo.</p>\n<p>Based on this article from Alex Krizhevsky.</p>\n<p><a href=\"https://code.google.com/p/cuda-convnet/wiki/Methodology\">https://code.google.com/p/cuda-convnet/wiki/Methodology</a></p>\n<p>Train with holout&nbsp;set until no improvement on holdout loss.<br>Remember the loss you are at with the trainset.<br>Then continue training on all data.. until you reach roughly the same loss as you were on the trainset before..<br><a href=\"https://www.kaggle.com/c/galaxy-zoo-the-galaxy-challenge/forums/t/7599/so-what-were-your-approaches/42880#post42880\">Graph</a><br><br>It takes a leap of faith and perhaps it's &quot;old&quot; knowledge..</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 65060,
      "author_name": "skylibrary",
      "author_url": "",
      "post_date": "02/27/2015 18:48:54",
      "content": "<p>thanks guys for the discussion, really helpful!</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "64791": "",
    "64827": "",
    "64985": "",
    "65011": "",
    "65060": ""
  },
  "source": "meta"
}