{
  "id": 127086,
  "title": "5th Place Solution",
  "url": "/competitions/ashrae-energy-prediction/discussion/127086",
  "author_name": "TASSAN",
  "post_date": "2020-01-22T07:54:55.492000",
  "votes": 22,
  "comment_count": 12,
  "views": 0,
  "content": "<p>First of all, we thank the kaggle and ASHRAE teams for holding the competition!</p>\n\n<p>I'm sorry my post was delayed due to my laziness.</p>\n\n<p>Our solution is not sophisticated and I think there is much room for improvement.\n(I want to apologize in advance, I don't use English in everyday life,\nso I'm not good at English)</p>\n\n<p>\nBelow is an overview of our solution.\n</p>\n\n<h2>Pre-proceeding</h2>\n\n<p>We dropped rows such as\n* Long streaks of constant values\n* Zero target values (only electricity)  </p>\n\n<p>By removing these data, the score was greatly improved.</p>\n\n<h2>Feature Engineering</h2>\n\n<p>We try two kinds of target encoding</p>\n\n<h3>1. percentile for each building_id, meter</h3>\n\n<p>As shown in the figure, the 5th and 95th percentile of the target value was calculated for each building_id and meter, and we used these features.\n</p>\n\n<p>In our case, these features improved the score.</p>\n\n<h3>2. propotion</h3>\n\n<p></p>\n\n<p>For each building_id, we apply these process.\n* Calculate median of target value per day of week.\n* Calculate its proportion (see figure).</p>\n\n<p>This is an example of day of week. We also apply this technique to hour, day, and so on.</p>\n\n<h2>Modeling</h2>\n\n<ul>\n<li>Using only LightGBM(train for each meter)\nWe apply two-step modeling\n<h3>Step1: Determine num_boost_round for each building_id</h3></li>\n</ul>\n\n<p></p>\n\n<ul>\n<li>Define training data(2016/01/15 ~ 2016/05/31) and validation data(2016/09/01 ~ 2016/12/31)</li>\n<li>Training with LightGBM and find early stopping round for each building_id(n1 ~ n1448).</li>\n</ul>\n\n<h3>Step2: Train with all train (year 2016) data and predict test data</h3>\n\n<p></p>\n\n<p>Training with all train data and predict test data.\nThe number of trees used for prediction were changed for each building_id (using n1~n1448 obtained in step1).</p>\n\n<p>This approach improved the public score, but the private score did not improve much.</p>\n\n<h2>Ensemble</h2>\n\n<ul>\n<li>Used leaked data(site 0,1,2,4,15).</li>\n<li>Weighted average for each meter and year(2017,2018).</li>\n</ul>\n\n<p>We also used other competitor's submission files.\nsub1: <a href=\"https://www.kaggle.com/purist1024/ashrae-simple-data-cleanup-lb-1-08-no-leaks\">https://www.kaggle.com/purist1024/ashrae-simple-data-cleanup-lb-1-08-no-leaks</a>\nsub2: <a href=\"https://www.kaggle.com/rohanrao/ashrae-half-and-half\">https://www.kaggle.com/rohanrao/ashrae-half-and-half</a></p>\n\n<h2>Submission</h2>\n\n<p>After ensemble, we achieve 1.047 on public LB) / 1.236 on private LB \n(1.058 on public LB / 1.272 on private LB in our single model)</p>\n\n<p><br>\nIf you have any questions, feel free to ask.\nThank you for reading.</p>",
  "messages": [
    {
      "id": 725517,
      "postDate": "2020-01-22T07:54:55.493Z",
      "content": "<p>First of all, we thank the kaggle and ASHRAE teams for holding the competition!</p>\n\n<p>I'm sorry my post was delayed due to my laziness.</p>\n\n<p>Our solution is not sophisticated and I think there is much room for improvement.\n(I want to apologize in advance, I don't use English in everyday life,\nso I'm not good at English)</p>\n\n<p>\nBelow is an overview of our solution.\n</p>\n\n<h2>Pre-proceeding</h2>\n\n<p>We dropped rows such as\n* Long streaks of constant values\n* Zero target values (only electricity)  </p>\n\n<p>By removing these data, the score was greatly improved.</p>\n\n<h2>Feature Engineering</h2>\n\n<p>We try two kinds of target encoding</p>\n\n<h3>1. percentile for each building_id, meter</h3>\n\n<p>As shown in the figure, the 5th and 95th percentile of the target value was calculated for each building_id and meter, and we used these features.\n</p>\n\n<p>In our case, these features improved the score.</p>\n\n<h3>2. propotion</h3>\n\n<p></p>\n\n<p>For each building_id, we apply these process.\n* Calculate median of target value per day of week.\n* Calculate its proportion (see figure).</p>\n\n<p>This is an example of day of week. We also apply this technique to hour, day, and so on.</p>\n\n<h2>Modeling</h2>\n\n<ul>\n<li>Using only LightGBM(train for each meter)\nWe apply two-step modeling\n<h3>Step1: Determine num_boost_round for each building_id</h3></li>\n</ul>\n\n<p></p>\n\n<ul>\n<li>Define training data(2016/01/15 ~ 2016/05/31) and validation data(2016/09/01 ~ 2016/12/31)</li>\n<li>Training with LightGBM and find early stopping round for each building_id(n1 ~ n1448).</li>\n</ul>\n\n<h3>Step2: Train with all train (year 2016) data and predict test data</h3>\n\n<p></p>\n\n<p>Training with all train data and predict test data.\nThe number of trees used for prediction were changed for each building_id (using n1~n1448 obtained in step1).</p>\n\n<p>This approach improved the public score, but the private score did not improve much.</p>\n\n<h2>Ensemble</h2>\n\n<ul>\n<li>Used leaked data(site 0,1,2,4,15).</li>\n<li>Weighted average for each meter and year(2017,2018).</li>\n</ul>\n\n<p>We also used other competitor's submission files.\nsub1: <a href=\"https://www.kaggle.com/purist1024/ashrae-simple-data-cleanup-lb-1-08-no-leaks\">https://www.kaggle.com/purist1024/ashrae-simple-data-cleanup-lb-1-08-no-leaks</a>\nsub2: <a href=\"https://www.kaggle.com/rohanrao/ashrae-half-and-half\">https://www.kaggle.com/rohanrao/ashrae-half-and-half</a></p>\n\n<h2>Submission</h2>\n\n<p>After ensemble, we achieve 1.047 on public LB) / 1.236 on private LB \n(1.058 on public LB / 1.272 on private LB in our single model)</p>\n\n<p><br>\nIf you have any questions, feel free to ask.\nThank you for reading.</p>",
      "rawMarkdown": "First of all, we thank the kaggle and ASHRAE teams for holding the competition!\n\nI'm sorry my post was delayed due to my laziness.\n\nOur solution is not sophisticated and I think there is much room for improvement.\n(I want to apologize in advance, I don't use English in everyday life,\nso I'm not good at English)\n\n\nBelow is an overview of our solution.\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2757787%2F3f61d8e1c651eefdb997c9e1ba133996%2Fsummary.png?generation=1579674727515075&amp;alt=media\" width=\"600px\">\n\n## Pre-proceeding\nWe dropped rows such as\n* Long streaks of constant values\n* Zero target values (only electricity)  \n\nBy removing these data, the score was greatly improved.\n\n## Feature Engineering\nWe try two kinds of target encoding\n\n### 1. percentile for each building_id, meter\nAs shown in the figure, the 5th and 95th percentile of the target value was calculated for each building_id and meter, and we used these features.\n<img src=\"https://user-images.githubusercontent.com/26999514/72871297-c7046c80-3d2d-11ea-9dbe-966b32847944.png\" width=\"400px\">\n\nIn our case, these features improved the score.\n\n### 2. propotion\n<img src=\"https://user-images.githubusercontent.com/26999514/72871535-8ce79a80-3d2e-11ea-8a0b-cccc389ffec2.png\" width=\"500px\">\n\nFor each building_id, we apply these process.\n* Calculate median of target value per day of week.\n* Calculate its proportion (see figure).\n\nThis is an example of day of week. We also apply this technique to hour, day, and so on.\n\n\n## Modeling\n* Using only LightGBM(train for each meter)\nWe apply two-step modeling\n### Step1: Determine num_boost_round for each building_id \n<img src=\"https://user-images.githubusercontent.com/26999514/72872521-e9e45000-3d30-11ea-82e9-1c81d0e19a97.png\" width=\"300px\">\n\n* Define training data(2016/01/15 ~ 2016/05/31) and validation data(2016/09/01 ~ 2016/12/31)\n* Training with LightGBM and find early stopping round for each building_id(n1 ~ n1448).\n\n### Step2: Train with all train (year 2016) data and predict test data\n<img src=\"https://user-images.githubusercontent.com/26999514/72873321-db973380-3d32-11ea-9a3c-26b9ed20cced.png\" width=\"300px\">\n\nTraining with all train data and predict test data.\nThe number of trees used for prediction were changed for each building_id (using n1~n1448 obtained in step1).\n\nThis approach improved the public score, but the private score did not improve much.\n\n## Ensemble\n* Used leaked data(site 0,1,2,4,15).\n* Weighted average for each meter and year(2017,2018).\n\nWe also used other competitor's submission files.\nsub1: https://www.kaggle.com/purist1024/ashrae-simple-data-cleanup-lb-1-08-no-leaks\nsub2: https://www.kaggle.com/rohanrao/ashrae-half-and-half\n\n## Submission\nAfter ensemble, we achieve 1.047 on public LB) / 1.236 on private LB \n(1.058 on public LB / 1.272 on private LB in our single model)\n\n<br>\nIf you have any questions, feel free to ask.\nThank you for reading.",
      "votes": 22
    },
    {
      "id": 725948,
      "postDate": "2020-01-22T17:01:11.920Z",
      "content": "<p>congrats,Thanks for solution method.Inspireful!</p>",
      "rawMarkdown": "congrats,Thanks for solution method.Inspireful!",
      "votes": 5,
      "replies": [
        {
          "id": 727867,
          "postDate": "2020-01-24T06:13:23.543Z",
          "content": "<p>Thanks!</p>",
          "rawMarkdown": "Thanks!",
          "votes": 1
        }
      ]
    },
    {
      "id": 727283,
      "postDate": "2020-01-23T15:50:35.250Z",
      "content": "<p>Any reason why you did not use June, July, August 2016 for training or validation data ?</p>\n\n<p>For step1, you have 1448 x 4 meter = 5792 models ?</p>\n\n<p>And for step2, you use back 5792 models from step1 but train using all 2016 data? </p>",
      "rawMarkdown": "Any reason why you did not use June, July, August 2016 for training or validation data ?\n\nFor step1, you have 1448 x 4 meter = 5792 models ?\n\nAnd for step2, you use back 5792 models from step1 but train using all 2016 data? ",
      "replies": [
        {
          "id": 727879,
          "postDate": "2020-01-24T06:37:22.927Z",
          "content": "<p>Thanks for your questions!</p>\n\n<ul>\n<li>Any reason why you did not use June, July, August 2016 for training or validation data ?</li>\n</ul>\n\n<p>→ In this competition case, We must predict 2018 target values using only 2016 data(can't use 2017 data for train).\nIn order to reflect such a situation in step 1, We didn't use June, July, and August data.</p>\n\n<ul>\n<li>For step1, you have 1448 x 4 meter = 5792 models ?\nAnd for step2, you use back 5792 models from step1 but train using all 2016 data?</li>\n</ul>\n\n<p>→ No, I trained one model per meter (4 models in total in step1).</p>",
          "rawMarkdown": "Thanks for your questions!\n\n* Any reason why you did not use June, July, August 2016 for training or validation data ?\n\n→ In this competition case, We must predict 2018 target values using only 2016 data(can't use 2017 data for train).\nIn order to reflect such a situation in step 1, We didn't use June, July, and August data.\n\n* For step1, you have 1448 x 4 meter = 5792 models ?\nAnd for step2, you use back 5792 models from step1 but train using all 2016 data?\n\n→ No, I trained one model per meter (4 models in total in step1).",
          "votes": 1
        }
      ]
    },
    {
      "id": 725631,
      "postDate": "2020-01-22T10:04:00.927Z",
      "content": "<p>Congrats &amp; Thanks for sharing!!🎉 😄 👍 </p>",
      "rawMarkdown": "Congrats &amp; Thanks for sharing!!🎉 😄 👍 ",
      "replies": [
        {
          "id": 727865,
          "postDate": "2020-01-24T06:12:56.903Z",
          "content": "<p>Thanks!</p>",
          "rawMarkdown": "Thanks!"
        }
      ]
    },
    {
      "id": 725543,
      "postDate": "2020-01-22T08:20:54.467Z",
      "content": "<p>Congrats!!</p>",
      "rawMarkdown": "Congrats!!",
      "replies": [
        {
          "id": 727864,
          "postDate": "2020-01-24T06:12:48.757Z",
          "content": "<p>Thanks!!</p>",
          "rawMarkdown": "Thanks!!"
        }
      ]
    },
    {
      "id": 725518,
      "postDate": "2020-01-22T07:55:34.707Z",
      "content": "<p>Congrats!</p>",
      "rawMarkdown": "Congrats!"
    },
    {
      "id": 2090906,
      "postDate": "2023-01-07T19:02:44.737Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 725655,
      "postDate": "2020-01-22T10:47:14.980Z",
      "rawMarkdown": "",
      "isDeleted": true,
      "replies": [
        {
          "id": 727866,
          "postDate": "2020-01-24T06:13:10.633Z",
          "content": "<p>Thanks!</p>",
          "rawMarkdown": "Thanks!"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 725948,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-01-22T17:01:11.920000",
      "content": "<p>congrats,Thanks for solution method.Inspireful!</p>",
      "votes": 5,
      "replies": [
        {
          "id": 727867,
          "author_name": "TASSAN",
          "author_url": "",
          "post_date": "2020-01-24T06:13:23.543000",
          "content": "<p>Thanks!</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 727283,
      "author_name": "Mr Loke",
      "author_url": "",
      "post_date": "2020-01-23T15:50:35.250000",
      "content": "<p>Any reason why you did not use June, July, August 2016 for training or validation data ?</p>\n\n<p>For step1, you have 1448 x 4 meter = 5792 models ?</p>\n\n<p>And for step2, you use back 5792 models from step1 but train using all 2016 data? </p>",
      "votes": 0,
      "replies": [
        {
          "id": 727879,
          "author_name": "TASSAN",
          "author_url": "",
          "post_date": "2020-01-24T06:37:22.927000",
          "content": "<p>Thanks for your questions!</p>\n\n<ul>\n<li>Any reason why you did not use June, July, August 2016 for training or validation data ?</li>\n</ul>\n\n<p>→ In this competition case, We must predict 2018 target values using only 2016 data(can't use 2017 data for train).\nIn order to reflect such a situation in step 1, We didn't use June, July, and August data.</p>\n\n<ul>\n<li>For step1, you have 1448 x 4 meter = 5792 models ?\nAnd for step2, you use back 5792 models from step1 but train using all 2016 data?</li>\n</ul>\n\n<p>→ No, I trained one model per meter (4 models in total in step1).</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 725631,
      "author_name": "Miyabon",
      "author_url": "",
      "post_date": "2020-01-22T10:04:00.927000",
      "content": "<p>Congrats &amp; Thanks for sharing!!🎉 😄 👍 </p>",
      "votes": 0,
      "replies": [
        {
          "id": 727865,
          "author_name": "TASSAN",
          "author_url": "",
          "post_date": "2020-01-24T06:12:56.903000",
          "content": "<p>Thanks!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 725543,
      "author_name": "MPEG",
      "author_url": "",
      "post_date": "2020-01-22T08:20:54.467000",
      "content": "<p>Congrats!!</p>",
      "votes": 0,
      "replies": [
        {
          "id": 727864,
          "author_name": "TASSAN",
          "author_url": "",
          "post_date": "2020-01-24T06:12:48.757000",
          "content": "<p>Thanks!!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 725518,
      "author_name": "YUYUTA",
      "author_url": "",
      "post_date": "2020-01-22T07:55:34.707000",
      "content": "<p>Congrats!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2090906,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-01-07T19:02:44.737000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 725655,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-01-22T10:47:14.980000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 727866,
          "author_name": "TASSAN",
          "author_url": "",
          "post_date": "2020-01-24T06:13:10.633000",
          "content": "<p>Thanks!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "725517": "First of all, we thank the kaggle and ASHRAE teams for holding the competition!\n\nI'm sorry my post was delayed due to my laziness.\n\nOur solution is not sophisticated and I think there is much room for improvement.\n(I want to apologize in advance, I don't use English in everyday life,\nso I'm not good at English)\n\n\nBelow is an overview of our solution.\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2757787%2F3f61d8e1c651eefdb997c9e1ba133996%2Fsummary.png?generation=1579674727515075&amp;alt=media\" width=\"600px\">\n\n## Pre-proceeding\nWe dropped rows such as\n* Long streaks of constant values\n* Zero target values (only electricity)  \n\nBy removing these data, the score was greatly improved.\n\n## Feature Engineering\nWe try two kinds of target encoding\n\n### 1. percentile for each building_id, meter\nAs shown in the figure, the 5th and 95th percentile of the target value was calculated for each building_id and meter, and we used these features.\n<img src=\"https://user-images.githubusercontent.com/26999514/72871297-c7046c80-3d2d-11ea-9dbe-966b32847944.png\" width=\"400px\">\n\nIn our case, these features improved the score.\n\n### 2. propotion\n<img src=\"https://user-images.githubusercontent.com/26999514/72871535-8ce79a80-3d2e-11ea-8a0b-cccc389ffec2.png\" width=\"500px\">\n\nFor each building_id, we apply these process.\n* Calculate median of target value per day of week.\n* Calculate its proportion (see figure).\n\nThis is an example of day of week. We also apply this technique to hour, day, and so on.\n\n\n## Modeling\n* Using only LightGBM(train for each meter)\nWe apply two-step modeling\n### Step1: Determine num_boost_round for each building_id \n<img src=\"https://user-images.githubusercontent.com/26999514/72872521-e9e45000-3d30-11ea-82e9-1c81d0e19a97.png\" width=\"300px\">\n\n* Define training data(2016/01/15 ~ 2016/05/31) and validation data(2016/09/01 ~ 2016/12/31)\n* Training with LightGBM and find early stopping round for each building_id(n1 ~ n1448).\n\n### Step2: Train with all train (year 2016) data and predict test data\n<img src=\"https://user-images.githubusercontent.com/26999514/72873321-db973380-3d32-11ea-9a3c-26b9ed20cced.png\" width=\"300px\">\n\nTraining with all train data and predict test data.\nThe number of trees used for prediction were changed for each building_id (using n1~n1448 obtained in step1).\n\nThis approach improved the public score, but the private score did not improve much.\n\n## Ensemble\n* Used leaked data(site 0,1,2,4,15).\n* Weighted average for each meter and year(2017,2018).\n\nWe also used other competitor's submission files.\nsub1: https://www.kaggle.com/purist1024/ashrae-simple-data-cleanup-lb-1-08-no-leaks\nsub2: https://www.kaggle.com/rohanrao/ashrae-half-and-half\n\n## Submission\nAfter ensemble, we achieve 1.047 on public LB) / 1.236 on private LB \n(1.058 on public LB / 1.272 on private LB in our single model)\n\n<br>\nIf you have any questions, feel free to ask.\nThank you for reading.",
    "725948": "congrats,Thanks for solution method.Inspireful!",
    "727283": "Any reason why you did not use June, July, August 2016 for training or validation data ?\n\nFor step1, you have 1448 x 4 meter = 5792 models ?\n\nAnd for step2, you use back 5792 models from step1 but train using all 2016 data? ",
    "725631": "Congrats &amp; Thanks for sharing!!🎉 😄 👍 ",
    "725543": "Congrats!!",
    "725518": "Congrats!",
    "2090906": "",
    "725655": ""
  }
}