{
  "id": 47554,
  "title": "18th Place Solution - Simple Improvement of Public Kernel",
  "url": "/competitions/favorita-grocery-sales-forecasting/writeups/takuya-akiyama-18th-place-solution-simple-improvem",
  "author_name": "",
  "post_date": "2018-01-16T09:39:42.017Z",
  "votes": 23,
  "comment_count": 1,
  "views": 0,
  "content": "<p>My approach is almost based on this kernel. <br>\n<a href=\"https://www.kaggle.com/vrtjso/lgbm-one-step-ahead\">https://www.kaggle.com/vrtjso/lgbm-one-step-ahead</a></p>\n\n<p>You can reach this rank by just improving kernel.</p>\n\n<ul>\n<li>Private Score  : 0.523 -&gt; 0.516</li>\n<li>Public Score : 0.515 -&gt; 0.508</li>\n</ul>\n\n<h2>Feature Engineering</h2>\n\n<p>In the kernel, most features were made from time series data of each combinations of stores and items. I added some variations of averaging features. Further more, I made similar features about stores and items separately, by aggregating unit_sales value and transaction data for each stores and items. Additional features affect public LB about 0.003.</p>\n\n<h2>Effective Use of Data</h2>\n\n<p>In this competition, we have to predict sales for the next 16 days after the given dataset. When we predict the data at the farthest days (16 days) based on time series features, we can only use data up to 16 days before the predicted date. The kernel used data up to 3 weeks before the prediction target period because of considering above reason and characteristics of the day of the week. \nHowever when predicting closer date sales, such as the next day or ten days later, more recent data can be used. So I used data up to 1 week before prediction date for predicting future 1-7days sales, and data up to 2 weeks before for predicting 8-14days sales. This improve public LB score about .002 (but maybe not affect private LB so much because LB is separated by target dates).</p>\n\n<h2>Extending Training Dataset for Predicting Test Set</h2>\n\n<p>For validation, the kernel uses a dataset from 26th July to 10th August as validation set, and data before the validation set was used for training models which predict validation set and test set. \nThis validation process is very important to confirm whether or not a model is overfitting. However when predicting test set, it is not good to only use the data that made for predict the validation set because dates for training and predicting dates are far away. So after validation process I retrain model using data which was extended 2 weeks, and predict test set by the model. This model improve public LB score about 0.002. </p>\n\n<p>Kaggle kernel always gives me useful information and stimulation.\nThanks for fantastic kernel authors and all competitors!</p>",
  "messages": [
    {
      "id": "269084",
      "postDate": "01/16/2018 07:02:26",
      "content": "<p>My approach is almost based on this kernel. <br>\n<a href=\"https://www.kaggle.com/vrtjso/lgbm-one-step-ahead\">https://www.kaggle.com/vrtjso/lgbm-one-step-ahead</a></p>\n\n<p>You can reach this rank by just improving kernel.</p>\n\n<ul>\n<li>Private Score  : 0.523 -&gt; 0.516</li>\n<li>Public Score : 0.515 -&gt; 0.508</li>\n</ul>\n\n<h2>Feature Engineering</h2>\n\n<p>In the kernel, most features were made from time series data of each combinations of stores and items. I added some variations of averaging features. Further more, I made similar features about stores and items separately, by aggregating unit_sales value and transaction data for each stores and items. Additional features affect public LB about 0.003.</p>\n\n<h2>Effective Use of Data</h2>\n\n<p>In this competition, we have to predict sales for the next 16 days after the given dataset. When we predict the data at the farthest days (16 days) based on time series features, we can only use data up to 16 days before the predicted date. The kernel used data up to 3 weeks before the prediction target period because of considering above reason and characteristics of the day of the week. \nHowever when predicting closer date sales, such as the next day or ten days later, more recent data can be used. So I used data up to 1 week before prediction date for predicting future 1-7days sales, and data up to 2 weeks before for predicting 8-14days sales. This improve public LB score about .002 (but maybe not affect private LB so much because LB is separated by target dates).</p>\n\n<h2>Extending Training Dataset for Predicting Test Set</h2>\n\n<p>For validation, the kernel uses a dataset from 26th July to 10th August as validation set, and data before the validation set was used for training models which predict validation set and test set. \nThis validation process is very important to confirm whether or not a model is overfitting. However when predicting test set, it is not good to only use the data that made for predict the validation set because dates for training and predicting dates are far away. So after validation process I retrain model using data which was extended 2 weeks, and predict test set by the model. This model improve public LB score about 0.002. </p>\n\n<p>Kaggle kernel always gives me useful information and stimulation.\nThanks for fantastic kernel authors and all competitors!</p>",
      "rawMarkdown": "My approach is almost based on this kernel.  \nhttps://www.kaggle.com/vrtjso/lgbm-one-step-ahead\n\nYou can reach this rank by just improving kernel.\n\n - Private Score  : 0.523 -&gt; 0.516\n - Public Score : 0.515 -&gt; 0.508\n\n## Feature Engineering\nIn the kernel, most features were made from time series data of each combinations of stores and items. I added some variations of averaging features. Further more, I made similar features about stores and items separately, by aggregating unit_sales value and transaction data for each stores and items. Additional features affect public LB about 0.003.\n\n## Effective Use of Data\nIn this competition, we have to predict sales for the next 16 days after the given dataset. When we predict the data at the farthest days (16 days) based on time series features, we can only use data up to 16 days before the predicted date. The kernel used data up to 3 weeks before the prediction target period because of considering above reason and characteristics of the day of the week. \nHowever when predicting closer date sales, such as the next day or ten days later, more recent data can be used. So I used data up to 1 week before prediction date for predicting future 1-7days sales, and data up to 2 weeks before for predicting 8-14days sales. This improve public LB score about .002 (but maybe not affect private LB so much because LB is separated by target dates).\n\n## Extending Training Dataset for Predicting Test Set\nFor validation, the kernel uses a dataset from 26th July to 10th August as validation set, and data before the validation set was used for training models which predict validation set and test set. \nThis validation process is very important to confirm whether or not a model is overfitting. However when predicting test set, it is not good to only use the data that made for predict the validation set because dates for training and predicting dates are far away. So after validation process I retrain model using data which was extended 2 weeks, and predict test set by the model. This model improve public LB score about 0.002. \n\nKaggle kernel always gives me useful information and stimulation.\nThanks for fantastic kernel authors and all competitors!",
      "votes": null
    },
    {
      "id": "269373",
      "postDate": "01/16/2018 17:47:26",
      "content": "<p>Thanks for sharing. Interesting comment that you retrained your model on all data (training+validation) before predicting on test data. Well done!</p>",
      "rawMarkdown": "Thanks for sharing. Interesting comment that you retrained your model on all data (training+validation) before predicting on test data. Well done!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 269373,
      "author_name": "fabsta",
      "author_url": "",
      "post_date": "01/16/2018 17:47:26",
      "content": "<p>Thanks for sharing. Interesting comment that you retrained your model on all data (training+validation) before predicting on test data. Well done!</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "269084": "My approach is almost based on this kernel.  \nhttps://www.kaggle.com/vrtjso/lgbm-one-step-ahead\n\nYou can reach this rank by just improving kernel.\n\n - Private Score  : 0.523 -&gt; 0.516\n - Public Score : 0.515 -&gt; 0.508\n\n## Feature Engineering\nIn the kernel, most features were made from time series data of each combinations of stores and items. I added some variations of averaging features. Further more, I made similar features about stores and items separately, by aggregating unit_sales value and transaction data for each stores and items. Additional features affect public LB about 0.003.\n\n## Effective Use of Data\nIn this competition, we have to predict sales for the next 16 days after the given dataset. When we predict the data at the farthest days (16 days) based on time series features, we can only use data up to 16 days before the predicted date. The kernel used data up to 3 weeks before the prediction target period because of considering above reason and characteristics of the day of the week. \nHowever when predicting closer date sales, such as the next day or ten days later, more recent data can be used. So I used data up to 1 week before prediction date for predicting future 1-7days sales, and data up to 2 weeks before for predicting 8-14days sales. This improve public LB score about .002 (but maybe not affect private LB so much because LB is separated by target dates).\n\n## Extending Training Dataset for Predicting Test Set\nFor validation, the kernel uses a dataset from 26th July to 10th August as validation set, and data before the validation set was used for training models which predict validation set and test set. \nThis validation process is very important to confirm whether or not a model is overfitting. However when predicting test set, it is not good to only use the data that made for predict the validation set because dates for training and predicting dates are far away. So after validation process I retrain model using data which was extended 2 weeks, and predict test set by the model. This model improve public LB score about 0.002. \n\nKaggle kernel always gives me useful information and stimulation.\nThanks for fantastic kernel authors and all competitors!",
    "269373": "Thanks for sharing. Interesting comment that you retrained your model on all data (training+validation) before predicting on test data. Well done!"
  },
  "source": "meta"
}