{
  "id": 1083,
  "title": "Purpose of valid_test and valid_training files?",
  "url": "/competitions/WhatDoYouKnow/discussion/1083",
  "author_name": "",
  "post_date": "2011-11-22T22:33:23.750Z",
  "votes": null,
  "comment_count": 16,
  "views": 8192,
  "content": "<p>I couldn't find the answer to this question on the data page or in the forums: what is the purpose of the valid_training.csv and valid_test.csv files?&nbsp;</p>",
  "messages": [
    {
      "id": "6715",
      "postDate": "11/22/2011 22:33:23",
      "content": "<p>I couldn't find the answer to this question on the data page or in the forums: what is the purpose of the valid_training.csv and valid_test.csv files?&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "6719",
      "postDate": "11/22/2011 23:11:15",
      "content": "<p>The purpose is to create a validation training and test set for participants to cross-validate different algorithms, without having to generate their own validation set. You can train each algorithm on the valid_training.csv file, have it predict for valid_test.csv,\r\n and compute the binomial deviance (since you have the outcomes for valid_test.csv) -- then you can estimate what that algorithm's performance would be on the actual test set (and choose an algorithm based on its performance on valid_test.csv). It's definitely\r\n not necessary (and there are likely better ways to generate a validation set), but I thought it might be useful for competitors who wanted a quick start on validation. Does that help?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "6723",
      "postDate": "11/22/2011 23:43:56",
      "content": "<p>How were valid_training.csv valid_test.csv created?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "6724",
      "postDate": "11/22/2011 23:47:19",
      "content": "<p>Thanks so much, Thomas, that explains it.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "6726",
      "postDate": "11/23/2011 00:02:37",
      "content": "<p>Chris -- the valid_test.csv is created by taking the last answer in the training set for every user in the test set; valid_training.csv is then all of the previous responses by those users, plus responses from users who aren't in the test set (it's described\r\n briefly at the bottom of&nbsp;http://www.kaggle.com/c/WhatDoYouKnow/Data)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8081",
      "postDate": "01/13/2012 01:04:34",
      "content": "<p>I'm still confused about training.csv and valid_training.csv.</p>\r\n<p>From the data description page, training.csv is generated as follows.<br>\r\n&quot;Any later answers by this user [in the test set] are removed, and any earlier answers are included in the training set. All answers from users not in the test set are also used for the training set&quot;</p>\r\n<p>And from your reply:<br>\r\n&quot;valid_training.csv is then all of the previous responses by those users [in the test set?], plus responses from users who aren't in the test set&quot;.</p>\r\n<p>So, what's the difference between them?</p>\r\n<p>Also, to my understanding, test.csv, training.csv and valid_test.csv are generated as follows. Am I correct?</p>\r\n<p>Let N(u) = no. of questions answered by user u.<br>\r\nLet Q(i,u) = the i-th question answered by user u.</p>\r\n<p>test.csv and training.csv:<br>\r\nfor each user u<br>\r\n---if N(u) &gt;= 6<br>\r\n------choose M=M(u) in {6,7,...,N(u)} at random<br>\r\n------insert into the test set the response to Q(M,u) <br>\r\n------insert into the training set the responses to<br>\r\n---------Q(1,u),...,Q(M-1,u)<br>\r\n---else<br>\r\n------insert into the training set the responses to<br>\r\n---------Q(1,u),...,Q(N(u),u)</p>\r\n<p>valid_test.csv:<br>\r\nfor each user u in the test set<br>\r\n---insert into the test set the response to Q(M(u)-1, u)</p>\r\n<p>By the way, as to the &quot;6th question&quot; (or i-th question, in general) answered by a user, what does &quot;6th&quot; mean? The 6th answered question when the questions are sorted in question<em>id, or the 6th answered question when the questions are sorted by &quot;answered</em>at&quot;?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8082",
      "postDate": "01/13/2012 01:15:55",
      "content": "<p>You're correct on the test/training generation. &nbsp;(ith question is the ith question, when ordered by answered_at). &nbsp;For valid_test and valid_training, this is a particition on the training set, using an algorithm like the following:</p>\r\n<p><span>valid_training.csv, valid_test.csv:</span><br>\r\n<span>for each user u</span></p>\r\n<p><span>if u is not in the test set</span></p>\r\n<p>---insert into valid_training the responses to Q(1,u)...Q(N(u), u)</p>\r\n<p><span>if u is in the test set</span><br>\r\n<span>---insert into valid_training the responses to Q(1,u)...Q(M(u)-2, u)</span></p>\r\n<p><span>---insert into valid_test the response to Q(M(u)-1, u)<br>\r\n</span></p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8139",
      "postDate": "01/17/2012 17:02:36",
      "content": "<p>Does not seem like the training/test files were created the way they are on the databoard</p>\r\n<p>The databoard says: &quot;The data used in this competition is a sample of Grockit students (from the past three years) answering questions to prepare for the sat, gmat, or act.&nbsp; The test/training split is derived by finding users who answered at least 6 questions,\r\n taking one of their answers (uniformly random, from their 6th question to their last), and inserting it into the test set.&nbsp; Any later answers by this user are removed, and any earlier answers are included in the training set&quot;</p>\r\n<p>&nbsp;</p>\r\n<p>Then how come, 1/5th of the students in the training set have answered only 1 question?<br>\r\n<br>\r\n</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8143",
      "postDate": "01/17/2012 18:20:21",
      "content": "<p>rkirana: if a user in the sample has not answered at least 6 questions, all their questions are still inserted into the training set (but they are not included in the test set)</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8153",
      "postDate": "01/18/2012 12:11:30",
      "content": "<div>\r\n<pre><span><br class=\"x_Apple-interchange-newline\">valid_training.csv, valid_test.csv:</span><br><span>for each user u</span></pre>\r\n<pre><span>if u is not in the test set</span></pre>\r\n<pre><span>---insert into valid_training the responses to Q(1,u)...Q(N(u), u)</span></pre>\r\n<pre><span>if u is in the test set</span><br><span>---insert into valid_training the responses to Q(1,u)...Q(M(u)-2, u)</span></pre>\r\n<pre><span>---insert into valid_test the response to Q(M(u)-1, u)</span></pre>\r\n</div>\r\n<div>@Thomas as in your algorithm, it seems that for most of traning set and valid_training set , we will have same rows.</div>\r\n<pre><span style=\"font-size:x-small\"><br></span></pre>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8160",
      "postDate": "01/18/2012 18:01:19",
      "content": "<p>mohit: that is correct, and intended</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8167",
      "postDate": "01/19/2012 03:13:30",
      "content": "<p>the validate set is not very reliable. my model does very well on valid_test. but binomial deviance is very high on real test set.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8168",
      "postDate": "01/19/2012 04:12:19",
      "content": "<p>re: Runxiao</p>\r\n<p>Just to state the common explanation:</p>\r\n<p>If you've custom tuned many parameters to get a very good score on the valid_test, then it is quite likely that you will not generalize as well to the real test set.</p>\r\n<p>By that I mean choosing how many training epochs for a neural network to use on the valid<em>train by repeatedly testing against valid</em>test will give you an incorrect number to use against the leaderboard.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8169",
      "postDate": "01/19/2012 04:24:28",
      "content": "<p>Runxiao,</p>\r\n<p>It seems reliable to me, please check this <a href=\"http://www.kaggle.com/c/WhatDoYouKnow/forums/t/1156/what-kind-of-accuracies-are-top-competitors-getting-against-the-valid-test\">\r\nthread</a>.</p>\r\n<p>How much difference between your validation CBD and the leaderboard CBD are you getting?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8260",
      "postDate": "01/25/2012 18:15:33",
      "content": "<p>for submissions: are we allowed to train our model on both valid_training.csv and training.csv?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8265",
      "postDate": "01/26/2012 01:03:21",
      "content": "<p>mathso, valid_training is just an abridged version of the training file so it shouldn't help.</p>\r\n<p>See the response by Thomas Lotze to mohit above.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8269",
      "postDate": "01/26/2012 09:03:32",
      "content": "<p>@matso : How would you use the training data as is? The valid training is a nice ready made proxy.<br>\r\n@Runxiao : I submitted my first hasty entry an hour ago and also calculated a cross validated sample from valid test and valid train. Are you using log to base e and not 10?</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 6719,
      "author_name": "thomaslotze",
      "author_url": "",
      "post_date": "11/22/2011 23:11:15",
      "content": "<p>The purpose is to create a validation training and test set for participants to cross-validate different algorithms, without having to generate their own validation set. You can train each algorithm on the valid_training.csv file, have it predict for valid_test.csv,\r\n and compute the binomial deviance (since you have the outcomes for valid_test.csv) -- then you can estimate what that algorithm's performance would be on the actual test set (and choose an algorithm based on its performance on valid_test.csv). It's definitely\r\n not necessary (and there are likely better ways to generate a validation set), but I thought it might be useful for competitors who wanted a quick start on validation. Does that help?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 6723,
      "author_name": "cdubois",
      "author_url": "",
      "post_date": "11/22/2011 23:43:56",
      "content": "<p>How were valid_training.csv valid_test.csv created?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 6724,
      "author_name": "robertlachlan",
      "author_url": "",
      "post_date": "11/22/2011 23:47:19",
      "content": "<p>Thanks so much, Thomas, that explains it.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 6726,
      "author_name": "thomaslotze",
      "author_url": "",
      "post_date": "11/23/2011 00:02:37",
      "content": "<p>Chris -- the valid_test.csv is created by taking the last answer in the training set for every user in the test set; valid_training.csv is then all of the previous responses by those users, plus responses from users who aren't in the test set (it's described\r\n briefly at the bottom of&nbsp;http://www.kaggle.com/c/WhatDoYouKnow/Data)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8081,
      "author_name": "thesuffocated",
      "author_url": "",
      "post_date": "01/13/2012 01:04:34",
      "content": "<p>I'm still confused about training.csv and valid_training.csv.</p>\r\n<p>From the data description page, training.csv is generated as follows.<br>\r\n&quot;Any later answers by this user [in the test set] are removed, and any earlier answers are included in the training set. All answers from users not in the test set are also used for the training set&quot;</p>\r\n<p>And from your reply:<br>\r\n&quot;valid_training.csv is then all of the previous responses by those users [in the test set?], plus responses from users who aren't in the test set&quot;.</p>\r\n<p>So, what's the difference between them?</p>\r\n<p>Also, to my understanding, test.csv, training.csv and valid_test.csv are generated as follows. Am I correct?</p>\r\n<p>Let N(u) = no. of questions answered by user u.<br>\r\nLet Q(i,u) = the i-th question answered by user u.</p>\r\n<p>test.csv and training.csv:<br>\r\nfor each user u<br>\r\n---if N(u) &gt;= 6<br>\r\n------choose M=M(u) in {6,7,...,N(u)} at random<br>\r\n------insert into the test set the response to Q(M,u) <br>\r\n------insert into the training set the responses to<br>\r\n---------Q(1,u),...,Q(M-1,u)<br>\r\n---else<br>\r\n------insert into the training set the responses to<br>\r\n---------Q(1,u),...,Q(N(u),u)</p>\r\n<p>valid_test.csv:<br>\r\nfor each user u in the test set<br>\r\n---insert into the test set the response to Q(M(u)-1, u)</p>\r\n<p>By the way, as to the &quot;6th question&quot; (or i-th question, in general) answered by a user, what does &quot;6th&quot; mean? The 6th answered question when the questions are sorted in question<em>id, or the 6th answered question when the questions are sorted by &quot;answered</em>at&quot;?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8082,
      "author_name": "thomaslotze",
      "author_url": "",
      "post_date": "01/13/2012 01:15:55",
      "content": "<p>You're correct on the test/training generation. &nbsp;(ith question is the ith question, when ordered by answered_at). &nbsp;For valid_test and valid_training, this is a particition on the training set, using an algorithm like the following:</p>\r\n<p><span>valid_training.csv, valid_test.csv:</span><br>\r\n<span>for each user u</span></p>\r\n<p><span>if u is not in the test set</span></p>\r\n<p>---insert into valid_training the responses to Q(1,u)...Q(N(u), u)</p>\r\n<p><span>if u is in the test set</span><br>\r\n<span>---insert into valid_training the responses to Q(1,u)...Q(M(u)-2, u)</span></p>\r\n<p><span>---insert into valid_test the response to Q(M(u)-1, u)<br>\r\n</span></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8139,
      "author_name": "rkirana",
      "author_url": "",
      "post_date": "01/17/2012 17:02:36",
      "content": "<p>Does not seem like the training/test files were created the way they are on the databoard</p>\r\n<p>The databoard says: &quot;The data used in this competition is a sample of Grockit students (from the past three years) answering questions to prepare for the sat, gmat, or act.&nbsp; The test/training split is derived by finding users who answered at least 6 questions,\r\n taking one of their answers (uniformly random, from their 6th question to their last), and inserting it into the test set.&nbsp; Any later answers by this user are removed, and any earlier answers are included in the training set&quot;</p>\r\n<p>&nbsp;</p>\r\n<p>Then how come, 1/5th of the students in the training set have answered only 1 question?<br>\r\n<br>\r\n</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8143,
      "author_name": "thomaslotze",
      "author_url": "",
      "post_date": "01/17/2012 18:20:21",
      "content": "<p>rkirana: if a user in the sample has not answered at least 6 questions, all their questions are still inserted into the training set (but they are not included in the test set)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8153,
      "author_name": "mohit29765",
      "author_url": "",
      "post_date": "01/18/2012 12:11:30",
      "content": "<div>\r\n<pre><span><br class=\"x_Apple-interchange-newline\">valid_training.csv, valid_test.csv:</span><br><span>for each user u</span></pre>\r\n<pre><span>if u is not in the test set</span></pre>\r\n<pre><span>---insert into valid_training the responses to Q(1,u)...Q(N(u), u)</span></pre>\r\n<pre><span>if u is in the test set</span><br><span>---insert into valid_training the responses to Q(1,u)...Q(M(u)-2, u)</span></pre>\r\n<pre><span>---insert into valid_test the response to Q(M(u)-1, u)</span></pre>\r\n</div>\r\n<div>@Thomas as in your algorithm, it seems that for most of traning set and valid_training set , we will have same rows.</div>\r\n<pre><span style=\"font-size:x-small\"><br></span></pre>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8160,
      "author_name": "thomaslotze",
      "author_url": "",
      "post_date": "01/18/2012 18:01:19",
      "content": "<p>mohit: that is correct, and intended</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8167,
      "author_name": "runxiao",
      "author_url": "",
      "post_date": "01/19/2012 03:13:30",
      "content": "<p>the validate set is not very reliable. my model does very well on valid_test. but binomial deviance is very high on real test set.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8168,
      "author_name": "biasvariance",
      "author_url": "",
      "post_date": "01/19/2012 04:12:19",
      "content": "<p>re: Runxiao</p>\r\n<p>Just to state the common explanation:</p>\r\n<p>If you've custom tuned many parameters to get a very good score on the valid_test, then it is quite likely that you will not generalize as well to the real test set.</p>\r\n<p>By that I mean choosing how many training epochs for a neural network to use on the valid<em>train by repeatedly testing against valid</em>test will give you an incorrect number to use against the leaderboard.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8169,
      "author_name": "jpetterson",
      "author_url": "",
      "post_date": "01/19/2012 04:24:28",
      "content": "<p>Runxiao,</p>\r\n<p>It seems reliable to me, please check this <a href=\"http://www.kaggle.com/c/WhatDoYouKnow/forums/t/1156/what-kind-of-accuracies-are-top-competitors-getting-against-the-valid-test\">\r\nthread</a>.</p>\r\n<p>How much difference between your validation CBD and the leaderboard CBD are you getting?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8260,
      "author_name": "mathso",
      "author_url": "",
      "post_date": "01/25/2012 18:15:33",
      "content": "<p>for submissions: are we allowed to train our model on both valid_training.csv and training.csv?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8265,
      "author_name": "jstreet",
      "author_url": "",
      "post_date": "01/26/2012 01:03:21",
      "content": "<p>mathso, valid_training is just an abridged version of the training file so it shouldn't help.</p>\r\n<p>See the response by Thomas Lotze to mohit above.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8269,
      "author_name": "pidtis",
      "author_url": "",
      "post_date": "01/26/2012 09:03:32",
      "content": "<p>@matso : How would you use the training data as is? The valid training is a nice ready made proxy.<br>\r\n@Runxiao : I submitted my first hasty entry an hour ago and also calculated a cross validated sample from valid test and valid train. Are you using log to base e and not 10?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "6715": "",
    "6719": "",
    "6723": "",
    "6724": "",
    "6726": "",
    "8081": "",
    "8082": "",
    "8139": "",
    "8143": "",
    "8153": "",
    "8160": "",
    "8167": "",
    "8168": "",
    "8169": "",
    "8260": "",
    "8265": "",
    "8269": ""
  },
  "source": "meta"
}