{
  "id": 67792,
  "title": "What is the correct validation scheme?",
  "url": "/competitions/ga-customer-revenue-prediction/discussion/67792",
  "author_name": "",
  "post_date": "2018-10-05T13:28:22.213721200Z",
  "votes": 5,
  "comment_count": 16,
  "views": 0,
  "content": "<p>In the past few days I have used group k-fold to test my model. However, decrease on CV doesn't translate onto PB. So today I turned to use time-based validation, but again CV and PB are not in the same direction.</p>\n\n<p>Here are my CV and PB:</p>\n\n<p>simple group k-fold:\nCV 1.6102 -&gt; PB 1.4384 and\nCV 1.5874 -&gt; PB 1.4406</p>\n\n<p>simple time-based:\nCV 1.6879 -&gt; PB 1.4471 and\nCV 1.6768 -&gt; PB 1.4531</p>\n\n<p>I feel confused and don't know what to do. Any suggestion please ?</p>",
  "messages": [
    {
      "id": "399244",
      "postDate": "10/05/2018 13:28:22",
      "content": "<p>In the past few days I have used group k-fold to test my model. However, decrease on CV doesn't translate onto PB. So today I turned to use time-based validation, but again CV and PB are not in the same direction.</p>\n\n<p>Here are my CV and PB:</p>\n\n<p>simple group k-fold:\nCV 1.6102 -&gt; PB 1.4384 and\nCV 1.5874 -&gt; PB 1.4406</p>\n\n<p>simple time-based:\nCV 1.6879 -&gt; PB 1.4471 and\nCV 1.6768 -&gt; PB 1.4531</p>\n\n<p>I feel confused and don't know what to do. Any suggestion please ?</p>",
      "rawMarkdown": "In the past few days I have used group k-fold to test my model. However, decrease on CV doesn't translate onto PB. So today I turned to use time-based validation, but again CV and PB are not in the same direction.\n\nHere are my CV and PB:\n\nsimple group k-fold:\nCV 1.6102 -&gt; PB 1.4384 and\nCV 1.5874 -&gt; PB 1.4406\n\nsimple time-based:\nCV 1.6879 -&gt; PB 1.4471 and\nCV 1.6768 -&gt; PB 1.4531\n\nI feel confused and don't know what to do. Any suggestion please ?",
      "votes": null
    },
    {
      "id": "399285",
      "postDate": "10/05/2018 14:46:20",
      "content": "<p>Hi, i would guess that you are probably overfitting, i use groupkfold and get extremely consistent difference between cv and lb.\nTry to drop some time based features and hits/page views ratio that i found to be overfitting to train data </p>",
      "rawMarkdown": "Hi, i would guess that you are probably overfitting, i use groupkfold and get extremely consistent difference between cv and lb.\nTry to drop some time based features and hits/page views ratio that i found to be overfitting to train data",
      "votes": null
    },
    {
      "id": "399347",
      "postDate": "10/05/2018 16:32:34",
      "content": "<p>Thanks for your sharing. I have a question. How did you know that some time based features and hits/page views ratio are causing overfitting?</p>\n\n<p>Did you check the difference of performances with/without these features? </p>",
      "rawMarkdown": "Thanks for your sharing. I have a question. How did you know that some time based features and hits/page views ratio are causing overfitting?\n\nDid you check the difference of performances with/without these features?",
      "votes": null
    },
    {
      "id": "399360",
      "postDate": "10/05/2018 17:01:43",
      "content": "<p>From my testing....After adding hits/pageviews ratio...The CV improve a lot while the LB drop around 0.01....</p>",
      "rawMarkdown": "From my testing....After adding hits/pageviews ratio...The CV improve a lot while the LB drop around 0.01....",
      "votes": null
    },
    {
      "id": "399372",
      "postDate": "10/05/2018 17:18:24",
      "content": "<p>Hi @YouHan,\nYes, i checked with and without.\nI will be more specific, using 'Day Of Month', 'Week Of Year' , and 'Hits\\Pageviews' have caused better CV and worse LB.\nAfter removing them, all my FE always kept very consistent LB-CV difference</p>",
      "rawMarkdown": "Hi @YouHan,\nYes, i checked with and without.\nI will be more specific, using 'Day Of Month', 'Week Of Year' , and 'Hits\\Pageviews' have caused better CV and worse LB.\nAfter removing them, all my FE always kept very consistent LB-CV difference",
      "votes": null
    },
    {
      "id": "399382",
      "postDate": "10/05/2018 17:31:21",
      "content": "<p>@AmirH. I appreciate the sharing of your experience. I understand what you did! I'm testing now to see the effect of removal of those features. If it works, I will share you!</p>",
      "rawMarkdown": "AmirH. I appreciate the sharing of your experience. I understand what you did! I'm testing now to see the effect of removal of those features. If it works, I will share you!",
      "votes": null
    },
    {
      "id": "399384",
      "postDate": "10/05/2018 17:32:34",
      "content": "<p>@Justin. Thanks for sharing!</p>",
      "rawMarkdown": "Justin. Thanks for sharing!",
      "votes": null
    },
    {
      "id": "399533",
      "postDate": "10/06/2018 03:36:53",
      "content": "<p>@AmirH. As testing the effect of time features and hits/pageviews, I got 0.002 boost!. Thanks for sharing!</p>",
      "rawMarkdown": "AmirH. As testing the effect of time features and hits/pageviews, I got 0.002 boost!. Thanks for sharing!",
      "votes": null
    },
    {
      "id": "399553",
      "postDate": "10/06/2018 04:52:00",
      "content": "<p>@AmirH.  Thanks for your suggest, I will go to a try. But why hits/page views ratio causes overfit, the feature looks logical？</p>",
      "rawMarkdown": "AmirH.  Thanks for your suggest, I will go to a try. But why hits/page views ratio causes overfit, the feature looks logical？",
      "votes": null
    },
    {
      "id": "399554",
      "postDate": "10/06/2018 04:53:24",
      "content": "<p>@Justin @YouHan thanks for your sharing!</p>",
      "rawMarkdown": "Justin @YouHan thanks for your sharing!",
      "votes": null
    },
    {
      "id": "399581",
      "postDate": "10/06/2018 06:20:32",
      "content": "<p>@YouHan great to hear!\nMay i ask how much boost does the categorical FE you added to oliviers kernel give you? </p>",
      "rawMarkdown": "YouHan great to hear!\nMay i ask how much boost does the categorical FE you added to oliviers kernel give you?",
      "votes": null
    },
    {
      "id": "399582",
      "postDate": "10/06/2018 06:23:22",
      "content": "<p>Hi @ethan.\nThis ratio is very significant in train set as shown in the specific discussion, but i suspect this behavior does not occur in test set for some reason, at least not in public LB set.\nThis is odd, but it is what it is</p>",
      "rawMarkdown": "Hi @ethan.\nThis ratio is very significant in train set as shown in the specific discussion, but i suspect this behavior does not occur in test set for some reason, at least not in public LB set.\nThis is odd, but it is what it is",
      "votes": null
    },
    {
      "id": "399589",
      "postDate": "10/06/2018 07:07:23",
      "content": "<p>@AmirH Actually, I added many categorical features, so it's not easy to say boost in exact number. Sorry for that!\nBut, for now, most of my features are categorical features using mean and frequency encoding.!</p>",
      "rawMarkdown": "AmirH Actually, I added many categorical features, so it's not easy to say boost in exact number. Sorry for that!\nBut, for now, most of my features are categorical features using mean and frequency encoding.!",
      "votes": null
    },
    {
      "id": "399604",
      "postDate": "10/06/2018 08:14:51",
      "content": "<p>time feature delete better?? i delete below code then LB &amp; CV get worse</p>\n\n<p><code>\nfor df in [train, test]: <br>\n     df['date'] = pd.to_datetime(df['visitStartTime'], unit='s') <br>\n     df['sess_date_dow'] = df['date'].dt.dayofweek <br>\n     df['sess_date_hours'] = df['date'].dt.hour <br>\n     df['sess_date_dom'] = df['date'].dt.day <br>\n</code></p>",
      "rawMarkdown": "time feature delete better?? i delete below code then LB &amp; CV get worse\n\n```\nfor df in [train, test]:  \n     df['date'] = pd.to_datetime(df['visitStartTime'], unit='s')  \n     df['sess_date_dow'] = df['date'].dt.dayofweek  \n     df['sess_date_hours'] = df['date'].dt.hour  \n     df['sess_date_dom'] = df['date'].dt.day  \n```",
      "votes": null
    },
    {
      "id": "399626",
      "postDate": "10/06/2018 09:51:49",
      "content": "<p>Really?\nI removed features from.day, month and hit/visit and then got a boost.</p>",
      "rawMarkdown": "Really?\nI removed features from.day, month and hit/visit and then got a boost.",
      "votes": null
    },
    {
      "id": "399628",
      "postDate": "10/06/2018 09:58:33",
      "content": "<p>Hi all, </p>\n\n<p>Seems removing time related features and hit/ratio improves LB, but be aware of overfitting LB, as final score is evaluated by PB...</p>",
      "rawMarkdown": "Hi all, \n\nSeems removing time related features and hit/ratio improves LB, but be aware of overfitting LB, as final score is evaluated by PB...",
      "votes": null
    },
    {
      "id": "399772",
      "postDate": "10/06/2018 18:13:31",
      "content": "<p>+1 same for me</p>",
      "rawMarkdown": "1 same for me",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 399285,
      "author_name": "tpthegreat",
      "author_url": "",
      "post_date": "10/05/2018 14:46:20",
      "content": "<p>Hi, i would guess that you are probably overfitting, i use groupkfold and get extremely consistent difference between cv and lb.\nTry to drop some time based features and hits/page views ratio that i found to be overfitting to train data </p>",
      "votes": null,
      "replies": [
        {
          "id": 399347,
          "author_name": "youhanlee",
          "author_url": "",
          "post_date": "10/05/2018 16:32:34",
          "content": "<p>Thanks for your sharing. I have a question. How did you know that some time based features and hits/page views ratio are causing overfitting?</p>\n\n<p>Did you check the difference of performances with/without these features? </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399360,
          "author_name": "reputation18",
          "author_url": "",
          "post_date": "10/05/2018 17:01:43",
          "content": "<p>From my testing....After adding hits/pageviews ratio...The CV improve a lot while the LB drop around 0.01....</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399372,
          "author_name": "tpthegreat",
          "author_url": "",
          "post_date": "10/05/2018 17:18:24",
          "content": "<p>Hi @YouHan,\nYes, i checked with and without.\nI will be more specific, using 'Day Of Month', 'Week Of Year' , and 'Hits\\Pageviews' have caused better CV and worse LB.\nAfter removing them, all my FE always kept very consistent LB-CV difference</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399382,
          "author_name": "youhanlee",
          "author_url": "",
          "post_date": "10/05/2018 17:31:21",
          "content": "<p>@AmirH. I appreciate the sharing of your experience. I understand what you did! I'm testing now to see the effect of removal of those features. If it works, I will share you!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399384,
          "author_name": "youhanlee",
          "author_url": "",
          "post_date": "10/05/2018 17:32:34",
          "content": "<p>@Justin. Thanks for sharing!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399533,
          "author_name": "youhanlee",
          "author_url": "",
          "post_date": "10/06/2018 03:36:53",
          "content": "<p>@AmirH. As testing the effect of time features and hits/pageviews, I got 0.002 boost!. Thanks for sharing!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399553,
          "author_name": "zhengyichen",
          "author_url": "",
          "post_date": "10/06/2018 04:52:00",
          "content": "<p>@AmirH.  Thanks for your suggest, I will go to a try. But why hits/page views ratio causes overfit, the feature looks logical？</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399554,
          "author_name": "zhengyichen",
          "author_url": "",
          "post_date": "10/06/2018 04:53:24",
          "content": "<p>@Justin @YouHan thanks for your sharing!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399581,
          "author_name": "tpthegreat",
          "author_url": "",
          "post_date": "10/06/2018 06:20:32",
          "content": "<p>@YouHan great to hear!\nMay i ask how much boost does the categorical FE you added to oliviers kernel give you? </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399582,
          "author_name": "tpthegreat",
          "author_url": "",
          "post_date": "10/06/2018 06:23:22",
          "content": "<p>Hi @ethan.\nThis ratio is very significant in train set as shown in the specific discussion, but i suspect this behavior does not occur in test set for some reason, at least not in public LB set.\nThis is odd, but it is what it is</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399589,
          "author_name": "youhanlee",
          "author_url": "",
          "post_date": "10/06/2018 07:07:23",
          "content": "<p>@AmirH Actually, I added many categorical features, so it's not easy to say boost in exact number. Sorry for that!\nBut, for now, most of my features are categorical features using mean and frequency encoding.!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399604,
          "author_name": "chocozzz",
          "author_url": "",
          "post_date": "10/06/2018 08:14:51",
          "content": "<p>time feature delete better?? i delete below code then LB &amp; CV get worse</p>\n\n<p><code>\nfor df in [train, test]: <br>\n     df['date'] = pd.to_datetime(df['visitStartTime'], unit='s') <br>\n     df['sess_date_dow'] = df['date'].dt.dayofweek <br>\n     df['sess_date_hours'] = df['date'].dt.hour <br>\n     df['sess_date_dom'] = df['date'].dt.day <br>\n</code></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399626,
          "author_name": "youhanlee",
          "author_url": "",
          "post_date": "10/06/2018 09:51:49",
          "content": "<p>Really?\nI removed features from.day, month and hit/visit and then got a boost.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399628,
          "author_name": "joe1995",
          "author_url": "",
          "post_date": "10/06/2018 09:58:33",
          "content": "<p>Hi all, </p>\n\n<p>Seems removing time related features and hit/ratio improves LB, but be aware of overfitting LB, as final score is evaluated by PB...</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 399772,
          "author_name": "xavierbourretsicotte",
          "author_url": "",
          "post_date": "10/06/2018 18:13:31",
          "content": "<p>+1 same for me</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "399244": "In the past few days I have used group k-fold to test my model. However, decrease on CV doesn't translate onto PB. So today I turned to use time-based validation, but again CV and PB are not in the same direction.\n\nHere are my CV and PB:\n\nsimple group k-fold:\nCV 1.6102 -&gt; PB 1.4384 and\nCV 1.5874 -&gt; PB 1.4406\n\nsimple time-based:\nCV 1.6879 -&gt; PB 1.4471 and\nCV 1.6768 -&gt; PB 1.4531\n\nI feel confused and don't know what to do. Any suggestion please ?",
    "399285": "Hi, i would guess that you are probably overfitting, i use groupkfold and get extremely consistent difference between cv and lb.\nTry to drop some time based features and hits/page views ratio that i found to be overfitting to train data",
    "399347": "Thanks for your sharing. I have a question. How did you know that some time based features and hits/page views ratio are causing overfitting?\n\nDid you check the difference of performances with/without these features?",
    "399360": "From my testing....After adding hits/pageviews ratio...The CV improve a lot while the LB drop around 0.01....",
    "399372": "Hi @YouHan,\nYes, i checked with and without.\nI will be more specific, using 'Day Of Month', 'Week Of Year' , and 'Hits\\Pageviews' have caused better CV and worse LB.\nAfter removing them, all my FE always kept very consistent LB-CV difference",
    "399382": "AmirH. I appreciate the sharing of your experience. I understand what you did! I'm testing now to see the effect of removal of those features. If it works, I will share you!",
    "399384": "Justin. Thanks for sharing!",
    "399533": "AmirH. As testing the effect of time features and hits/pageviews, I got 0.002 boost!. Thanks for sharing!",
    "399553": "AmirH.  Thanks for your suggest, I will go to a try. But why hits/page views ratio causes overfit, the feature looks logical？",
    "399554": "Justin @YouHan thanks for your sharing!",
    "399581": "YouHan great to hear!\nMay i ask how much boost does the categorical FE you added to oliviers kernel give you?",
    "399582": "Hi @ethan.\nThis ratio is very significant in train set as shown in the specific discussion, but i suspect this behavior does not occur in test set for some reason, at least not in public LB set.\nThis is odd, but it is what it is",
    "399589": "AmirH Actually, I added many categorical features, so it's not easy to say boost in exact number. Sorry for that!\nBut, for now, most of my features are categorical features using mean and frequency encoding.!",
    "399604": "time feature delete better?? i delete below code then LB &amp; CV get worse\n\n```\nfor df in [train, test]:  \n     df['date'] = pd.to_datetime(df['visitStartTime'], unit='s')  \n     df['sess_date_dow'] = df['date'].dt.dayofweek  \n     df['sess_date_hours'] = df['date'].dt.hour  \n     df['sess_date_dom'] = df['date'].dt.day  \n```",
    "399626": "Really?\nI removed features from.day, month and hit/visit and then got a boost.",
    "399628": "Hi all, \n\nSeems removing time related features and hit/ratio improves LB, but be aware of overfitting LB, as final score is evaluated by PB...",
    "399772": "1 same for me"
  },
  "source": "meta"
}