{
  "id": 82604,
  "title": "My solution - please learn from my mistakes",
  "url": "/competitions/ga-customer-revenue-prediction/discussion/82604",
  "author_name": "AmirH",
  "post_date": "2019-03-02T18:51:39.138000",
  "votes": 10,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Hi Kagglers,\nI know this competition was problematic in many ways, but I enjoyed it.\nespecially after the reboot.\nThank you to Kaggle, Google and R Studio for setting this up.</p>\n\n<p>I went all in for this competition, because, as an R user, i wanted to be eligible for the R Prize.</p>\n\n<p>I did scrape the GA data demo data, and managed to match 1800K~ ClientID\\fullVisitorIDs that continued to visit and purchase during october and November.</p>\n\n<p>Making my goal to predict the target without 2 months gap.</p>\n\n<hr>\n\n<p><em>So what happened:</em>\n- I wanted the most updated data from my scraping, so i only started integrating this data in the last day.</p>\n\n<ul>\n<li><p>When I ran my entire pipeline, i noticed that 1 of the main features was calculated wrong the whole time, since the start of the competition. \nSo I changed it in the last moment to a correct calculation, and after waiting for the entire pipeline to run, i saw that it absolutely wrecked my CV score.</p></li>\n<li><p>It was already too late to run the pipeline again, so i simply submitted it as is.</p></li>\n<li><p>Then I had an issue of missing the deadline by 5 minutes because of difference between winter and summer time, having been used to submit by 3am  in all past competitions.\nI sent kaggle right away my submissions explaining my issue, and they were awesome to let me know in the last day  before the scoring that they managed to use my submissions.\nThank you @PhilCullinton!!!</p></li>\n<li><p>I'm pretty sure that if i would've submitted using my untouched model i would've at least get a gold and be eligible for one of the top 5 R Prizes.</p></li>\n</ul>\n\n<hr>\n\n<p><em>What i learned:</em>\n- Always save aside your features to load them faster, not having to calculate them every time.</p>\n\n<ul>\n<li><p>DON'T make any changes on the last day, unless it's something you can immediately see its effect on CV</p></li>\n<li><p>If you're waiting on some kind of data to implement, whether it be scraped data or models from a teammate, ask for a sample of the data so you can prepare integration code that runs successfully ahead of time.</p></li>\n</ul>\n\n<hr>\n\n<p><em>Now for my approach - which i wrote when the competition was done a few months ago, can't remember much of it now:</em></p>\n\n<ul>\n<li><p>My training data consisted of 15 sets of data from the first date we have until a specific month, with 45 day gap that IS used also in training (because i scraped the GA data and knew i will have it), and target was 2 months following the gap.\nThe visitorIDs i used for each set for only those that visited during the Gap.\nmy validation was simple 5fold.</p></li>\n<li><p>I did scrape GA demo data, and managed to match 1800K~ ClientID\\fullVisitorIDs that continued to visit and purchase during october and November.</p></li>\n<li><p>I used featured such as: days from first\\last visit\\purchase until target period, how many days is the user active, mean days between visits\\purchases, how many uniqueN month with purchases, also month as category, and some more.</p></li>\n<li><p>My model pipeline included LGBM, XGB as level 1 predictors, next was NN that used most features + the LGBM and XGB OOF predictions, and last, linear regression with only these 3 models OOF predictions</p></li>\n</ul>\n\n<p>Thanks for reading!!</p>",
  "messages": [
    {
      "id": 482327,
      "postDate": "2019-03-02T18:51:39.140Z",
      "content": "<p>Hi Kagglers,\nI know this competition was problematic in many ways, but I enjoyed it.\nespecially after the reboot.\nThank you to Kaggle, Google and R Studio for setting this up.</p>\n\n<p>I went all in for this competition, because, as an R user, i wanted to be eligible for the R Prize.</p>\n\n<p>I did scrape the GA data demo data, and managed to match 1800K~ ClientID\\fullVisitorIDs that continued to visit and purchase during october and November.</p>\n\n<p>Making my goal to predict the target without 2 months gap.</p>\n\n<hr>\n\n<p><em>So what happened:</em>\n- I wanted the most updated data from my scraping, so i only started integrating this data in the last day.</p>\n\n<ul>\n<li><p>When I ran my entire pipeline, i noticed that 1 of the main features was calculated wrong the whole time, since the start of the competition. \nSo I changed it in the last moment to a correct calculation, and after waiting for the entire pipeline to run, i saw that it absolutely wrecked my CV score.</p></li>\n<li><p>It was already too late to run the pipeline again, so i simply submitted it as is.</p></li>\n<li><p>Then I had an issue of missing the deadline by 5 minutes because of difference between winter and summer time, having been used to submit by 3am  in all past competitions.\nI sent kaggle right away my submissions explaining my issue, and they were awesome to let me know in the last day  before the scoring that they managed to use my submissions.\nThank you @PhilCullinton!!!</p></li>\n<li><p>I'm pretty sure that if i would've submitted using my untouched model i would've at least get a gold and be eligible for one of the top 5 R Prizes.</p></li>\n</ul>\n\n<hr>\n\n<p><em>What i learned:</em>\n- Always save aside your features to load them faster, not having to calculate them every time.</p>\n\n<ul>\n<li><p>DON'T make any changes on the last day, unless it's something you can immediately see its effect on CV</p></li>\n<li><p>If you're waiting on some kind of data to implement, whether it be scraped data or models from a teammate, ask for a sample of the data so you can prepare integration code that runs successfully ahead of time.</p></li>\n</ul>\n\n<hr>\n\n<p><em>Now for my approach - which i wrote when the competition was done a few months ago, can't remember much of it now:</em></p>\n\n<ul>\n<li><p>My training data consisted of 15 sets of data from the first date we have until a specific month, with 45 day gap that IS used also in training (because i scraped the GA data and knew i will have it), and target was 2 months following the gap.\nThe visitorIDs i used for each set for only those that visited during the Gap.\nmy validation was simple 5fold.</p></li>\n<li><p>I did scrape GA demo data, and managed to match 1800K~ ClientID\\fullVisitorIDs that continued to visit and purchase during october and November.</p></li>\n<li><p>I used featured such as: days from first\\last visit\\purchase until target period, how many days is the user active, mean days between visits\\purchases, how many uniqueN month with purchases, also month as category, and some more.</p></li>\n<li><p>My model pipeline included LGBM, XGB as level 1 predictors, next was NN that used most features + the LGBM and XGB OOF predictions, and last, linear regression with only these 3 models OOF predictions</p></li>\n</ul>\n\n<p>Thanks for reading!!</p>",
      "rawMarkdown": "Hi Kagglers,\nI know this competition was problematic in many ways, but I enjoyed it.\nespecially after the reboot.\nThank you to Kaggle, Google and R Studio for setting this up.\n\nI went all in for this competition, because, as an R user, i wanted to be eligible for the R Prize.\n\nI did scrape the GA data demo data, and managed to match 1800K~ ClientID\\fullVisitorIDs that continued to visit and purchase during october and November.\n\nMaking my goal to predict the target without 2 months gap.\n\n-----------------------------------------\n\n*So what happened:*\n- I wanted the most updated data from my scraping, so i only started integrating this data in the last day.\n\n- When I ran my entire pipeline, i noticed that 1 of the main features was calculated wrong the whole time, since the start of the competition. \nSo I changed it in the last moment to a correct calculation, and after waiting for the entire pipeline to run, i saw that it absolutely wrecked my CV score.\n\n- It was already too late to run the pipeline again, so i simply submitted it as is.\n\n- Then I had an issue of missing the deadline by 5 minutes because of difference between winter and summer time, having been used to submit by 3am  in all past competitions.\nI sent kaggle right away my submissions explaining my issue, and they were awesome to let me know in the last day  before the scoring that they managed to use my submissions.\nThank you @PhilCullinton!!!\n\n- I'm pretty sure that if i would've submitted using my untouched model i would've at least get a gold and be eligible for one of the top 5 R Prizes.\n\n------------------------------------------------\n\n*What i learned:*\n- Always save aside your features to load them faster, not having to calculate them every time.\n\n- DON'T make any changes on the last day, unless it's something you can immediately see its effect on CV\n\n- If you're waiting on some kind of data to implement, whether it be scraped data or models from a teammate, ask for a sample of the data so you can prepare integration code that runs successfully ahead of time.\n\n---------------------------------------\n\n*Now for my approach - which i wrote when the competition was done a few months ago, can't remember much of it now:*\n\n- My training data consisted of 15 sets of data from the first date we have until a specific month, with 45 day gap that IS used also in training (because i scraped the GA data and knew i will have it), and target was 2 months following the gap.\nThe visitorIDs i used for each set for only those that visited during the Gap.\nmy validation was simple 5fold.\n\n- I did scrape GA demo data, and managed to match 1800K~ ClientID\\fullVisitorIDs that continued to visit and purchase during october and November.\n\n- I used featured such as: days from first\\last visit\\purchase until target period, how many days is the user active, mean days between visits\\purchases, how many uniqueN month with purchases, also month as category, and some more.\n\n- My model pipeline included LGBM, XGB as level 1 predictors, next was NN that used most features + the LGBM and XGB OOF predictions, and last, linear regression with only these 3 models OOF predictions\n\nThanks for reading!!",
      "votes": 10
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "482327": "Hi Kagglers,\nI know this competition was problematic in many ways, but I enjoyed it.\nespecially after the reboot.\nThank you to Kaggle, Google and R Studio for setting this up.\n\nI went all in for this competition, because, as an R user, i wanted to be eligible for the R Prize.\n\nI did scrape the GA data demo data, and managed to match 1800K~ ClientID\\fullVisitorIDs that continued to visit and purchase during october and November.\n\nMaking my goal to predict the target without 2 months gap.\n\n-----------------------------------------\n\n*So what happened:*\n- I wanted the most updated data from my scraping, so i only started integrating this data in the last day.\n\n- When I ran my entire pipeline, i noticed that 1 of the main features was calculated wrong the whole time, since the start of the competition. \nSo I changed it in the last moment to a correct calculation, and after waiting for the entire pipeline to run, i saw that it absolutely wrecked my CV score.\n\n- It was already too late to run the pipeline again, so i simply submitted it as is.\n\n- Then I had an issue of missing the deadline by 5 minutes because of difference between winter and summer time, having been used to submit by 3am  in all past competitions.\nI sent kaggle right away my submissions explaining my issue, and they were awesome to let me know in the last day  before the scoring that they managed to use my submissions.\nThank you @PhilCullinton!!!\n\n- I'm pretty sure that if i would've submitted using my untouched model i would've at least get a gold and be eligible for one of the top 5 R Prizes.\n\n------------------------------------------------\n\n*What i learned:*\n- Always save aside your features to load them faster, not having to calculate them every time.\n\n- DON'T make any changes on the last day, unless it's something you can immediately see its effect on CV\n\n- If you're waiting on some kind of data to implement, whether it be scraped data or models from a teammate, ask for a sample of the data so you can prepare integration code that runs successfully ahead of time.\n\n---------------------------------------\n\n*Now for my approach - which i wrote when the competition was done a few months ago, can't remember much of it now:*\n\n- My training data consisted of 15 sets of data from the first date we have until a specific month, with 45 day gap that IS used also in training (because i scraped the GA data and knew i will have it), and target was 2 months following the gap.\nThe visitorIDs i used for each set for only those that visited during the Gap.\nmy validation was simple 5fold.\n\n- I did scrape GA demo data, and managed to match 1800K~ ClientID\\fullVisitorIDs that continued to visit and purchase during october and November.\n\n- I used featured such as: days from first\\last visit\\purchase until target period, how many days is the user active, mean days between visits\\purchases, how many uniqueN month with purchases, also month as category, and some more.\n\n- My model pipeline included LGBM, XGB as level 1 predictors, next was NN that used most features + the LGBM and XGB OOF predictions, and last, linear regression with only these 3 models OOF predictions\n\nThanks for reading!!"
  },
  "complete": true,
  "source": "existing_discussion",
  "competition_id": 10038,
  "competition_slug": "ga-customer-revenue-prediction",
  "team_id": 2100709,
  "solution_url": "/competitions/ga-customer-revenue-prediction/writeups/amirh-r-only-my-solution-please-learn-from-my-mist"
}