{
  "id": 47749,
  "title": "preliminary LB 16th solution——Self-examination of a violator",
  "url": "/competitions/favorita-grocery-sales-forecasting/discussion/47749",
  "author_name": "",
  "post_date": "2018-01-18T10:59:22.599953700Z",
  "votes": 8,
  "comment_count": 4,
  "views": 0,
  "content": "<h2>Self-examination</h2>\n\n<pre><code>Sorry to tell everyone, I violate the rule. My 16th rank was removed by kaggle after preliminary LB public 12 hours later. Our team used a second account to submit for about 9 times total in the last 6 days. I am very very sad and regrettable. Suddenly fell from the mountain into the bottom.\n\nThis is our first kaggle competition after I learned machine learning myself for about 8 months, so we are not particularly clear about specific rules. We participated this competition at 11/24/2017 and only do this competition every day in the next 2 months.  I actually know this behavior of our team, and I also participated in. Although I know this behavior violate the rule, I still do this because I don't read the rule even once. I just heard the second account that for submit will be cleaned and I don't know the main account will be removed too. I had been searched this question that another account for submission online in Baidu or Zhihu and nothing can be found. So I relaxed vigilance and just think this is a small trick. I am too silly and foolish. If I know the result i will never do that. I told my mother I had ranked 1% in 1709 teams the first time and my mom was proud of me. Now I don't dare to tell the truth to her.\n\nSorry to everyone and sorry to myself ! \n\nThere is no record in this competition about me. I just want to prove I had been here before. I wish I could feel better after i post this discussion. \n</code></pre>\n\n<h2>Solution</h2>\n\n<pre><code>I am new to kaggle and machine learning compared to many experts and masters. So my experience may inspire some new like me. Although I violate the rule, but I don't think the improvement of these extra nine submissions would be much for a new. \n\nMy solution is a update version of Bojan Tunguz's lgb model. \n\nhttps://www.kaggle.com/tunguz/lgbm-one-step-ahead-c8de0f/code\n\nThe final weighted average can not improve the public LB score, so the final score is just a single model lightgbm.\n</code></pre>\n\n<ol>\n<li><p>Holidays</p>\n\n<p>I had tried some methods to handle holidays and the pubilc LB score are all decrease. </p>\n\n<p>We had tried to replace the holidays' sales with the sales a week before the holiday according to specific store_item combination. Because the sales according to specific store_item combination highly related to the day of the week, so i wanted to smooth the effect of holidays. </p>\n\n<p>We had also divide the sales at holidays by 1.5/0.7, it also don't  work well.</p>\n\n<p>So i didn't take holidays into account at last. </p></li>\n<li><p>Categorical features</p>\n\n<p>There are many categorical variable in this competition, like type, cluster, city, state, family, class, perishable, store, item.  Cashine Lee's <em>LGBM Starter</em> only use the sales of store-item combination. According to these categorical variable, there are many kinds of combination, like city_item, city_type, family_class etc. So there are many hide information. </p>\n\n<p>We use Boruta to select features from these combination. These features are (mean/std/min/max/median)  (sales/transactions)  over the last  (3/7/14/30/60/140) days. </p>\n\n<p>Although we select many features from method above and public LB score increase at the beginning , we decide adopt only 2 from these combination, city_item and country_item(the country's sales of this item) from the perspective of preventing overfitting and reducing calculation. Because  there is a lot of redundancy between features above from other categorical features combinations.</p>\n\n<p>These can improve the public score from 0.514 to 0.512 with Bojan Tunguz's lgb model. </p></li>\n<li><p>other featues</p>\n\n<p>We counted NaN values from past 7/14/30 day sales, and NaN values from past 7/14/30 day onpromotion. These can improve the public score from 0.512 to 0.511.</p>\n\n<p>And I also dropped some redundancy  features from Bojan Tunguz's lgb model according to the importance. These can reduce the calculation.</p>\n\n<p>Although some other features are not so important, like store_nbr, item_nbr, but can improve the score 0.001 too. You can download the code below.</p></li>\n<li><p>Key Training Set Settings</p>\n\n<p>Public kernels are all predict future 16 days' sales use data before 7.26. We think this method cannot take full advantage of recent data from 7.26 to 8.15. So we decide to divide 16 models into 3 parts. </p>\n\n<p>The first part of model predict sales in first 6 days of next 16 days, we can set data from 5.31 to 8.2 as training set and data 8.9 as validation sets.</p>\n\n<p>The second part of model predict sales in middle 7 days of next 16 days, we can set data from 5.31 to 7.26 as training set and data 8.2 as validation sets.</p>\n\n<p>The third part of model predict sales in last 3 days of next 16 days, we can set data from 5.31 to 7.19 as training set and data 7.26 as validation sets.</p>\n\n<p>These can improve  the public score from 0.511 to 0.509.</p>\n\n<p>Another discovery is we find start the date from 6.7 can be better than start the date from 5.31.\nIt could be there is a National Holiday Mother's Day in May and there is big influence to sales.</p>\n\n<p>Finally, we canceled validation sets to use more recent data.</p>\n\n<p>These can improve the public score from 0.509 to 0.508. And the final private score of 0.508 is 0.516.</p></li>\n</ol>\n\n<h2>Ending</h2>\n\n<p>Above is almost all I want to share. You can download code for a better understanding. Perhaps these settings do not seem difficult, but I really spent a lot of effort to find out.</p>",
  "messages": [
    {
      "id": "270502",
      "postDate": "01/18/2018 10:59:22",
      "content": "<h2>Self-examination</h2>\n\n<pre><code>Sorry to tell everyone, I violate the rule. My 16th rank was removed by kaggle after preliminary LB public 12 hours later. Our team used a second account to submit for about 9 times total in the last 6 days. I am very very sad and regrettable. Suddenly fell from the mountain into the bottom.\n\nThis is our first kaggle competition after I learned machine learning myself for about 8 months, so we are not particularly clear about specific rules. We participated this competition at 11/24/2017 and only do this competition every day in the next 2 months.  I actually know this behavior of our team, and I also participated in. Although I know this behavior violate the rule, I still do this because I don't read the rule even once. I just heard the second account that for submit will be cleaned and I don't know the main account will be removed too. I had been searched this question that another account for submission online in Baidu or Zhihu and nothing can be found. So I relaxed vigilance and just think this is a small trick. I am too silly and foolish. If I know the result i will never do that. I told my mother I had ranked 1% in 1709 teams the first time and my mom was proud of me. Now I don't dare to tell the truth to her.\n\nSorry to everyone and sorry to myself ! \n\nThere is no record in this competition about me. I just want to prove I had been here before. I wish I could feel better after i post this discussion. \n</code></pre>\n\n<h2>Solution</h2>\n\n<pre><code>I am new to kaggle and machine learning compared to many experts and masters. So my experience may inspire some new like me. Although I violate the rule, but I don't think the improvement of these extra nine submissions would be much for a new. \n\nMy solution is a update version of Bojan Tunguz's lgb model. \n\nhttps://www.kaggle.com/tunguz/lgbm-one-step-ahead-c8de0f/code\n\nThe final weighted average can not improve the public LB score, so the final score is just a single model lightgbm.\n</code></pre>\n\n<ol>\n<li><p>Holidays</p>\n\n<p>I had tried some methods to handle holidays and the pubilc LB score are all decrease. </p>\n\n<p>We had tried to replace the holidays' sales with the sales a week before the holiday according to specific store_item combination. Because the sales according to specific store_item combination highly related to the day of the week, so i wanted to smooth the effect of holidays. </p>\n\n<p>We had also divide the sales at holidays by 1.5/0.7, it also don't  work well.</p>\n\n<p>So i didn't take holidays into account at last. </p></li>\n<li><p>Categorical features</p>\n\n<p>There are many categorical variable in this competition, like type, cluster, city, state, family, class, perishable, store, item.  Cashine Lee's <em>LGBM Starter</em> only use the sales of store-item combination. According to these categorical variable, there are many kinds of combination, like city_item, city_type, family_class etc. So there are many hide information. </p>\n\n<p>We use Boruta to select features from these combination. These features are (mean/std/min/max/median)  (sales/transactions)  over the last  (3/7/14/30/60/140) days. </p>\n\n<p>Although we select many features from method above and public LB score increase at the beginning , we decide adopt only 2 from these combination, city_item and country_item(the country's sales of this item) from the perspective of preventing overfitting and reducing calculation. Because  there is a lot of redundancy between features above from other categorical features combinations.</p>\n\n<p>These can improve the public score from 0.514 to 0.512 with Bojan Tunguz's lgb model. </p></li>\n<li><p>other featues</p>\n\n<p>We counted NaN values from past 7/14/30 day sales, and NaN values from past 7/14/30 day onpromotion. These can improve the public score from 0.512 to 0.511.</p>\n\n<p>And I also dropped some redundancy  features from Bojan Tunguz's lgb model according to the importance. These can reduce the calculation.</p>\n\n<p>Although some other features are not so important, like store_nbr, item_nbr, but can improve the score 0.001 too. You can download the code below.</p></li>\n<li><p>Key Training Set Settings</p>\n\n<p>Public kernels are all predict future 16 days' sales use data before 7.26. We think this method cannot take full advantage of recent data from 7.26 to 8.15. So we decide to divide 16 models into 3 parts. </p>\n\n<p>The first part of model predict sales in first 6 days of next 16 days, we can set data from 5.31 to 8.2 as training set and data 8.9 as validation sets.</p>\n\n<p>The second part of model predict sales in middle 7 days of next 16 days, we can set data from 5.31 to 7.26 as training set and data 8.2 as validation sets.</p>\n\n<p>The third part of model predict sales in last 3 days of next 16 days, we can set data from 5.31 to 7.19 as training set and data 7.26 as validation sets.</p>\n\n<p>These can improve  the public score from 0.511 to 0.509.</p>\n\n<p>Another discovery is we find start the date from 6.7 can be better than start the date from 5.31.\nIt could be there is a National Holiday Mother's Day in May and there is big influence to sales.</p>\n\n<p>Finally, we canceled validation sets to use more recent data.</p>\n\n<p>These can improve the public score from 0.509 to 0.508. And the final private score of 0.508 is 0.516.</p></li>\n</ol>\n\n<h2>Ending</h2>\n\n<p>Above is almost all I want to share. You can download code for a better understanding. Perhaps these settings do not seem difficult, but I really spent a lot of effort to find out.</p>",
      "rawMarkdown": "## Self-examination ##\n    Sorry to tell everyone, I violate the rule. My 16th rank was removed by kaggle after preliminary LB public 12 hours later. Our team used a second account to submit for about 9 times total in the last 6 days. I am very very sad and regrettable. Suddenly fell from the mountain into the bottom.\n\n    This is our first kaggle competition after I learned machine learning myself for about 8 months, so we are not particularly clear about specific rules. We participated this competition at 11/24/2017 and only do this competition every day in the next 2 months.  I actually know this behavior of our team, and I also participated in. Although I know this behavior violate the rule, I still do this because I don't read the rule even once. I just heard the second account that for submit will be cleaned and I don't know the main account will be removed too. I had been searched this question that another account for submission online in Baidu or Zhihu and nothing can be found. So I relaxed vigilance and just think this is a small trick. I am too silly and foolish. If I know the result i will never do that. I told my mother I had ranked 1% in 1709 teams the first time and my mom was proud of me. Now I don't dare to tell the truth to her.\n\n    Sorry to everyone and sorry to myself ! \n\n    There is no record in this competition about me. I just want to prove I had been here before. I wish I could feel better after i post this discussion. \n\n## Solution ##\n    I am new to kaggle and machine learning compared to many experts and masters. So my experience may inspire some new like me. Although I violate the rule, but I don't think the improvement of these extra nine submissions would be much for a new. \n\n    My solution is a update version of Bojan Tunguz's lgb model. \n\n    https://www.kaggle.com/tunguz/lgbm-one-step-ahead-c8de0f/code\n\n    The final weighted average can not improve the public LB score, so the final score is just a single model lightgbm.\n\n 1. Holidays\n\n    I had tried some methods to handle holidays and the pubilc LB score are all decrease. \n\n    We had tried to replace the holidays' sales with the sales a week before the holiday according to specific store_item combination. Because the sales according to specific store_item combination highly related to the day of the week, so i wanted to smooth the effect of holidays. \n\n    We had also divide the sales at holidays by 1.5/0.7, it also don't  work well.\n\n    So i didn't take holidays into account at last. \n\n 2. Categorical features\n\n    There are many categorical variable in this competition, like type, cluster, city, state, family, class, perishable, store, item.  Cashine Lee's *LGBM Starter* only use the sales of store-item combination. According to these categorical variable, there are many kinds of combination, like city_item, city_type, family_class etc. So there are many hide information. \n  \n    We use Boruta to select features from these combination. These features are (mean/std/min/max/median)  (sales/transactions)  over the last  (3/7/14/30/60/140) days. \n\n    Although we select many features from method above and public LB score increase at the beginning , we decide adopt only 2 from these combination, city_item and country_item(the country's sales of this item) from the perspective of preventing overfitting and reducing calculation. Because  there is a lot of redundancy between features above from other categorical features combinations.\n \n    These can improve the public score from 0.514 to 0.512 with Bojan Tunguz's lgb model. \n\n 3. other featues\n\n    We counted NaN values from past 7/14/30 day sales, and NaN values from past 7/14/30 day onpromotion. These can improve the public score from 0.512 to 0.511.\n\n    And I also dropped some redundancy  features from Bojan Tunguz's lgb model according to the importance. These can reduce the calculation.\n\n    Although some other features are not so important, like store_nbr, item_nbr, but can improve the score 0.001 too. You can download the code below.\n\n 4. Key Training Set Settings\n\n    Public kernels are all predict future 16 days' sales use data before 7.26. We think this method cannot take full advantage of recent data from 7.26 to 8.15. So we decide to divide 16 models into 3 parts. \n\n    The first part of model predict sales in first 6 days of next 16 days, we can set data from 5.31 to 8.2 as training set and data 8.9 as validation sets.\n\n    The second part of model predict sales in middle 7 days of next 16 days, we can set data from 5.31 to 7.26 as training set and data 8.2 as validation sets.\n    \n    The third part of model predict sales in last 3 days of next 16 days, we can set data from 5.31 to 7.19 as training set and data 7.26 as validation sets.\n\n    These can improve  the public score from 0.511 to 0.509.\n\n    Another discovery is we find start the date from 6.7 can be better than start the date from 5.31.\nIt could be there is a National Holiday Mother's Day in May and there is big influence to sales.\n\n    Finally, we canceled validation sets to use more recent data.\n\n    These can improve the public score from 0.509 to 0.508. And the final private score of 0.508 is 0.516.\n\n\n## Ending ##\nAbove is almost all I want to share. You can download code for a better understanding. Perhaps these settings do not seem difficult, but I really spent a lot of effort to find out.",
      "votes": null
    },
    {
      "id": "277838",
      "postDate": "02/04/2018 14:25:51",
      "content": "<p>Thanks for your solutions and thank you !</p>",
      "rawMarkdown": "Thanks for your solutions and thank you !",
      "votes": null
    },
    {
      "id": "278024",
      "postDate": "02/05/2018 06:44:59",
      "content": "<p>I think you split the prediction parts into three parts so that we can take good use of recent information which is quite a nice trick for this kind of problem. And not to use special days to construct label is still very important. </p>\n\n<p>After taking look at your code, it looks like that you forget to read data trans.   </p>\n\n<p>Thanks for sharing again.</p>",
      "rawMarkdown": "I think you split the prediction parts into three parts so that we can take good use of recent information which is quite a nice trick for this kind of problem. And not to use special days to construct label is still very important. \n\nAfter taking look at your code, it looks like that you forget to read data trans.   \n\nThanks for sharing again.",
      "votes": null
    },
    {
      "id": "278080",
      "postDate": "02/05/2018 10:13:27",
      "content": "<p>I had tried transactions data with different combination of categorical features,  but these features did't work well,  so I did't take transactions into account at last.</p>",
      "rawMarkdown": "I had tried transactions data with different combination of categorical features,  but these features did't work well,  so I did't take transactions into account at last.",
      "votes": null
    },
    {
      "id": "278081",
      "postDate": "02/05/2018 10:17:59",
      "content": "<p>Thank you for your reply. I am very happy someone can comment on this discussion.</p>",
      "rawMarkdown": "Thank you for your reply. I am very happy someone can comment on this discussion.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 277838,
      "author_name": "longyin2",
      "author_url": "",
      "post_date": "02/04/2018 14:25:51",
      "content": "<p>Thanks for your solutions and thank you !</p>",
      "votes": null,
      "replies": [
        {
          "id": 278081,
          "author_name": "shangweichen",
          "author_url": "",
          "post_date": "02/05/2018 10:17:59",
          "content": "<p>Thank you for your reply. I am very happy someone can comment on this discussion.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 278024,
      "author_name": "longyin2",
      "author_url": "",
      "post_date": "02/05/2018 06:44:59",
      "content": "<p>I think you split the prediction parts into three parts so that we can take good use of recent information which is quite a nice trick for this kind of problem. And not to use special days to construct label is still very important. </p>\n\n<p>After taking look at your code, it looks like that you forget to read data trans.   </p>\n\n<p>Thanks for sharing again.</p>",
      "votes": null,
      "replies": [
        {
          "id": 278080,
          "author_name": "shangweichen",
          "author_url": "",
          "post_date": "02/05/2018 10:13:27",
          "content": "<p>I had tried transactions data with different combination of categorical features,  but these features did't work well,  so I did't take transactions into account at last.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "270502": "## Self-examination ##\n    Sorry to tell everyone, I violate the rule. My 16th rank was removed by kaggle after preliminary LB public 12 hours later. Our team used a second account to submit for about 9 times total in the last 6 days. I am very very sad and regrettable. Suddenly fell from the mountain into the bottom.\n\n    This is our first kaggle competition after I learned machine learning myself for about 8 months, so we are not particularly clear about specific rules. We participated this competition at 11/24/2017 and only do this competition every day in the next 2 months.  I actually know this behavior of our team, and I also participated in. Although I know this behavior violate the rule, I still do this because I don't read the rule even once. I just heard the second account that for submit will be cleaned and I don't know the main account will be removed too. I had been searched this question that another account for submission online in Baidu or Zhihu and nothing can be found. So I relaxed vigilance and just think this is a small trick. I am too silly and foolish. If I know the result i will never do that. I told my mother I had ranked 1% in 1709 teams the first time and my mom was proud of me. Now I don't dare to tell the truth to her.\n\n    Sorry to everyone and sorry to myself ! \n\n    There is no record in this competition about me. I just want to prove I had been here before. I wish I could feel better after i post this discussion. \n\n## Solution ##\n    I am new to kaggle and machine learning compared to many experts and masters. So my experience may inspire some new like me. Although I violate the rule, but I don't think the improvement of these extra nine submissions would be much for a new. \n\n    My solution is a update version of Bojan Tunguz's lgb model. \n\n    https://www.kaggle.com/tunguz/lgbm-one-step-ahead-c8de0f/code\n\n    The final weighted average can not improve the public LB score, so the final score is just a single model lightgbm.\n\n 1. Holidays\n\n    I had tried some methods to handle holidays and the pubilc LB score are all decrease. \n\n    We had tried to replace the holidays' sales with the sales a week before the holiday according to specific store_item combination. Because the sales according to specific store_item combination highly related to the day of the week, so i wanted to smooth the effect of holidays. \n\n    We had also divide the sales at holidays by 1.5/0.7, it also don't  work well.\n\n    So i didn't take holidays into account at last. \n\n 2. Categorical features\n\n    There are many categorical variable in this competition, like type, cluster, city, state, family, class, perishable, store, item.  Cashine Lee's *LGBM Starter* only use the sales of store-item combination. According to these categorical variable, there are many kinds of combination, like city_item, city_type, family_class etc. So there are many hide information. \n  \n    We use Boruta to select features from these combination. These features are (mean/std/min/max/median)  (sales/transactions)  over the last  (3/7/14/30/60/140) days. \n\n    Although we select many features from method above and public LB score increase at the beginning , we decide adopt only 2 from these combination, city_item and country_item(the country's sales of this item) from the perspective of preventing overfitting and reducing calculation. Because  there is a lot of redundancy between features above from other categorical features combinations.\n \n    These can improve the public score from 0.514 to 0.512 with Bojan Tunguz's lgb model. \n\n 3. other featues\n\n    We counted NaN values from past 7/14/30 day sales, and NaN values from past 7/14/30 day onpromotion. These can improve the public score from 0.512 to 0.511.\n\n    And I also dropped some redundancy  features from Bojan Tunguz's lgb model according to the importance. These can reduce the calculation.\n\n    Although some other features are not so important, like store_nbr, item_nbr, but can improve the score 0.001 too. You can download the code below.\n\n 4. Key Training Set Settings\n\n    Public kernels are all predict future 16 days' sales use data before 7.26. We think this method cannot take full advantage of recent data from 7.26 to 8.15. So we decide to divide 16 models into 3 parts. \n\n    The first part of model predict sales in first 6 days of next 16 days, we can set data from 5.31 to 8.2 as training set and data 8.9 as validation sets.\n\n    The second part of model predict sales in middle 7 days of next 16 days, we can set data from 5.31 to 7.26 as training set and data 8.2 as validation sets.\n    \n    The third part of model predict sales in last 3 days of next 16 days, we can set data from 5.31 to 7.19 as training set and data 7.26 as validation sets.\n\n    These can improve  the public score from 0.511 to 0.509.\n\n    Another discovery is we find start the date from 6.7 can be better than start the date from 5.31.\nIt could be there is a National Holiday Mother's Day in May and there is big influence to sales.\n\n    Finally, we canceled validation sets to use more recent data.\n\n    These can improve the public score from 0.509 to 0.508. And the final private score of 0.508 is 0.516.\n\n\n## Ending ##\nAbove is almost all I want to share. You can download code for a better understanding. Perhaps these settings do not seem difficult, but I really spent a lot of effort to find out.",
    "277838": "Thanks for your solutions and thank you !",
    "278024": "I think you split the prediction parts into three parts so that we can take good use of recent information which is quite a nice trick for this kind of problem. And not to use special days to construct label is still very important. \n\nAfter taking look at your code, it looks like that you forget to read data trans.   \n\nThanks for sharing again.",
    "278080": "I had tried transactions data with different combination of categorical features,  but these features did't work well,  so I did't take transactions into account at last.",
    "278081": "Thank you for your reply. I am very happy someone can comment on this discussion."
  },
  "source": "meta"
}