{
  "id": 418486,
  "title": "99th Place Solution - LightGBM and Rule-based Multiplier",
  "content": "<h1>Basic strategy</h1>\n<h3>How to get 5 months predictions</h3>\n<p>In this competition, we were required to make predictions for up to 5 months ahead. I decided to obtain 5 months of predictions by repeating the 1 month forecast five times. This approach made it easier to take advantage of the excellent predictions for January 2023 from the Public Notebook.</p>\n<h3>Validation</h3>\n<p>For validation, I used 5 months of data from August 2023 to December 2023. For the 1-month ahead forecast, I used data up to November 2023 for the December 2023 prediction and data up to July 2023 for the August 2023 prediction. For the 5-month ahead forecast, I used data up to July 2023 for the December 2023 prediction and data up to March 2023 for the August 2023 prediction. Using this method, I created predictions for each month as 1-month ahead to 5-months ahead predictions. I adjusted the models and features based on this validation score.</p>\n<h3>External data and Population Adjustment</h3>\n<p>Based on <a href=\"https://www.kaggle.com/competitions/godaddy-microbusiness-density-forecasting/discussion/389215\" target=\"_blank\">Chris Deotte's explanation</a>, I adjusted the microbusiness density values based on population, ensuring that the denominator of microbusiness density was the population of the same year throughout the data. As external data, I incorporated the census data given by the host and the data of cfips locations into the model. I did not utilize any other external data because they didn't improve my validation scores.</p>\n<h1>Models</h1>\n<h3>Overview</h3>\n<p>The overview of the prediction model is as follows. I used the model of <a href=\"https://www.kaggle.com/code/titericz/better-xgb-baseline\" target=\"_blank\">Giba's excellent notebook</a> as the starting model. Then I made rule-based adjustments to get the prediction values. I got hints for rule-based adjustments from Chris Deotte's notebook (<a href=\"https://www.kaggle.com/code/cdeotte/linear-regression-baseline-lb-1-092\" target=\"_blank\">here</a> and <a href=\"https://www.kaggle.com/code/cdeotte/seasonal-model-with-validation-lb-1-091\" target=\"_blank\">here</a>).</p>\n<h3>Base model</h3>\n<p>For the base model, I mostly adopted the preprocessing (including outlier corrections), feature engineering and target transformation from Giba's notebook. I used a LightGBM model with a small number of trees (n_estimators=30) as the model since complex models tended to overfit quickly according to the validation results. The remaining settings were determined through experiments based on the validation score. </p>\n<ul>\n<li>I didn't use a blacklist. </li>\n<li>I tried several settings for outlier correction and the number of lag and window variables</li>\n<li>I excluded cfips with less than 140 active values from models.</li>\n</ul>\n<p>This model gives an upward trend for most cfips. As pointed out in various notebooks, microbusiness density showed a global upward trend, so I believe this model roughly captures that trend.</p>\n<h3>Adhoc rules</h3>\n<p>I implemented two types of rule-based adjustments: trend-based and seasonal effects. These adjustments exclude cfips with low active values. For trend-based adjustments, I prepared rules such as \"For cfips that have increased 1+x times in the last n months (or n-1 months), the average of the growth rate is multiplied by 1-y to obtain the new growth rate.\" Since applying the same rule repeatedly up to 5 months ahead often leads to overfitting, my adjustments become more conservative for farther predictions. For example, when creating the May 2023 prediction from the April 2023 prediction, trend-based adjustments are hardly applied.</p>\n<p>Regarding seasonal effects, I assumed effects based on months and prepared rules such as \"For cfips that have  increased by 1+x times or more compared to the previous month every time in the same month in the past, the average of the growth rate is multiplied by 1-y to obtain the new growth rate.\" It might be difficult to obtain conclusive evidence of the monthly effects based on the training data alone, but considering that what we want to predict is the economic index and validation scores were improved by this rule , I assumed their existence.  </p>\n<p>In these rule-based adjustments, I implemented both upward and downward adjustments. However, considering the property of SMAPE, where downward deviations are less desirable than upward deviations, I made aggressive adjustments in the upward direction and conservative adjustments in the downward direction. In case of overlapping adjustments, I took the average. The threshold and detailed settings of the rules were determined through experiments based on the validation score.</p>\n<h1>Getting predictions and creating submission files</h1>\n<p>To get predictions, I used the best score from the Public Notebook as the starting point for the January 2023 prediction and incorporated the results of Public LB probing. The Public LB probing consists in the same rule-based approach described above. I applied multiple adjustments for both long-term and short-term trends in addition to seasonal effects. Using the obtained January 2023 prediction as the starting point, I made predictions up to May 2023 by repeating the 1-month ahead forecast. I also applied adjustments shown in <a href=\"https://www.kaggle.com/code/vitalykudelya/use-discrete-nature-of-microbusiness-density\" target=\"_blank\">Vitaly Kudelya's notebook</a> to the obtained predictions.<br>\nWe can submit two files as final submission. For one submission, I submitted the prediction where rule-based adjustments were aggressive, and for the other submission I submitted the prediction where rule-based adjustments were modest. As a result, the former one was better than the latter one, which held also in validation scores.</p>\n<h1>Acknowledgements</h1>\n<p>Most of the basic ideas were fairly simple and derived from public notebooks. Setting up appropriate validations was cumbersome, but by attempting the combinations of these ideas based on the validation scores, I was able to achieve this rank. Thanks to Kagglers for many thoughtful and helpful notebooks and discussions. In competitions like this one, where the Public LB and Private LB data differ significantly, it can be difficult to determine what to trust, but preparing reliable validation is crucial above all else. My code is available at <a href=\"https://github.com/KazuakiTokunaga/kaggle-godaddy\" target=\"_blank\">github</a>. </p>",
  "comments": [],
  "comment_count": 0,
  "messages": [
    {
      "id": 2311123,
      "postDate": "2023-06-20T23:37:49.687Z",
      "content": "<h1>Basic strategy</h1>\n<h3>How to get 5 months predictions</h3>\n<p>In this competition, we were required to make predictions for up to 5 months ahead. I decided to obtain 5 months of predictions by repeating the 1 month forecast five times. This approach made it easier to take advantage of the excellent predictions for January 2023 from the Public Notebook.</p>\n<h3>Validation</h3>\n<p>For validation, I used 5 months of data from August 2023 to December 2023. For the 1-month ahead forecast, I used data up to November 2023 for the December 2023 prediction and data up to July 2023 for the August 2023 prediction. For the 5-month ahead forecast, I used data up to July 2023 for the December 2023 prediction and data up to March 2023 for the August 2023 prediction. Using this method, I created predictions for each month as 1-month ahead to 5-months ahead predictions. I adjusted the models and features based on this validation score.</p>\n<h3>External data and Population Adjustment</h3>\n<p>Based on <a href=\"https://www.kaggle.com/competitions/godaddy-microbusiness-density-forecasting/discussion/389215\" target=\"_blank\">Chris Deotte's explanation</a>, I adjusted the microbusiness density values based on population, ensuring that the denominator of microbusiness density was the population of the same year throughout the data. As external data, I incorporated the census data given by the host and the data of cfips locations into the model. I did not utilize any other external data because they didn't improve my validation scores.</p>\n<h1>Models</h1>\n<h3>Overview</h3>\n<p>The overview of the prediction model is as follows. I used the model of <a href=\"https://www.kaggle.com/code/titericz/better-xgb-baseline\" target=\"_blank\">Giba's excellent notebook</a> as the starting model. Then I made rule-based adjustments to get the prediction values. I got hints for rule-based adjustments from Chris Deotte's notebook (<a href=\"https://www.kaggle.com/code/cdeotte/linear-regression-baseline-lb-1-092\" target=\"_blank\">here</a> and <a href=\"https://www.kaggle.com/code/cdeotte/seasonal-model-with-validation-lb-1-091\" target=\"_blank\">here</a>).</p>\n<h3>Base model</h3>\n<p>For the base model, I mostly adopted the preprocessing (including outlier corrections), feature engineering and target transformation from Giba's notebook. I used a LightGBM model with a small number of trees (n_estimators=30) as the model since complex models tended to overfit quickly according to the validation results. The remaining settings were determined through experiments based on the validation score. </p>\n<ul>\n<li>I didn't use a blacklist. </li>\n<li>I tried several settings for outlier correction and the number of lag and window variables</li>\n<li>I excluded cfips with less than 140 active values from models.</li>\n</ul>\n<p>This model gives an upward trend for most cfips. As pointed out in various notebooks, microbusiness density showed a global upward trend, so I believe this model roughly captures that trend.</p>\n<h3>Adhoc rules</h3>\n<p>I implemented two types of rule-based adjustments: trend-based and seasonal effects. These adjustments exclude cfips with low active values. For trend-based adjustments, I prepared rules such as \"For cfips that have increased 1+x times in the last n months (or n-1 months), the average of the growth rate is multiplied by 1-y to obtain the new growth rate.\" Since applying the same rule repeatedly up to 5 months ahead often leads to overfitting, my adjustments become more conservative for farther predictions. For example, when creating the May 2023 prediction from the April 2023 prediction, trend-based adjustments are hardly applied.</p>\n<p>Regarding seasonal effects, I assumed effects based on months and prepared rules such as \"For cfips that have  increased by 1+x times or more compared to the previous month every time in the same month in the past, the average of the growth rate is multiplied by 1-y to obtain the new growth rate.\" It might be difficult to obtain conclusive evidence of the monthly effects based on the training data alone, but considering that what we want to predict is the economic index and validation scores were improved by this rule , I assumed their existence.  </p>\n<p>In these rule-based adjustments, I implemented both upward and downward adjustments. However, considering the property of SMAPE, where downward deviations are less desirable than upward deviations, I made aggressive adjustments in the upward direction and conservative adjustments in the downward direction. In case of overlapping adjustments, I took the average. The threshold and detailed settings of the rules were determined through experiments based on the validation score.</p>\n<h1>Getting predictions and creating submission files</h1>\n<p>To get predictions, I used the best score from the Public Notebook as the starting point for the January 2023 prediction and incorporated the results of Public LB probing. The Public LB probing consists in the same rule-based approach described above. I applied multiple adjustments for both long-term and short-term trends in addition to seasonal effects. Using the obtained January 2023 prediction as the starting point, I made predictions up to May 2023 by repeating the 1-month ahead forecast. I also applied adjustments shown in <a href=\"https://www.kaggle.com/code/vitalykudelya/use-discrete-nature-of-microbusiness-density\" target=\"_blank\">Vitaly Kudelya's notebook</a> to the obtained predictions.<br>\nWe can submit two files as final submission. For one submission, I submitted the prediction where rule-based adjustments were aggressive, and for the other submission I submitted the prediction where rule-based adjustments were modest. As a result, the former one was better than the latter one, which held also in validation scores.</p>\n<h1>Acknowledgements</h1>\n<p>Most of the basic ideas were fairly simple and derived from public notebooks. Setting up appropriate validations was cumbersome, but by attempting the combinations of these ideas based on the validation scores, I was able to achieve this rank. Thanks to Kagglers for many thoughtful and helpful notebooks and discussions. In competitions like this one, where the Public LB and Private LB data differ significantly, it can be difficult to determine what to trust, but preparing reliable validation is crucial above all else. My code is available at <a href=\"https://github.com/KazuakiTokunaga/kaggle-godaddy\" target=\"_blank\">github</a>. </p>",
      "rawMarkdown": "# Basic strategy\n### How to get 5 months predictions\nIn this competition, we were required to make predictions for up to 5 months ahead. I decided to obtain 5 months of predictions by repeating the 1 month forecast five times. This approach made it easier to take advantage of the excellent predictions for January 2023 from the Public Notebook.\n\n### Validation\nFor validation, I used 5 months of data from August 2023 to December 2023. For the 1-month ahead forecast, I used data up to November 2023 for the December 2023 prediction and data up to July 2023 for the August 2023 prediction. For the 5-month ahead forecast, I used data up to July 2023 for the December 2023 prediction and data up to March 2023 for the August 2023 prediction. Using this method, I created predictions for each month as 1-month ahead to 5-months ahead predictions. I adjusted the models and features based on this validation score.\n\n### External data and Population Adjustment\nBased on [Chris Deotte's explanation](https://www.kaggle.com/competitions/godaddy-microbusiness-density-forecasting/discussion/389215), I adjusted the microbusiness density values based on population, ensuring that the denominator of microbusiness density was the population of the same year throughout the data. As external data, I incorporated the census data given by the host and the data of cfips locations into the model. I did not utilize any other external data because they didn't improve my validation scores.\n\n# Models\n### Overview\nThe overview of the prediction model is as follows. I used the model of [Giba's excellent notebook](https://www.kaggle.com/code/titericz/better-xgb-baseline) as the starting model. Then I made rule-based adjustments to get the prediction values. I got hints for rule-based adjustments from Chris Deotte's notebook ([here](https://www.kaggle.com/code/cdeotte/linear-regression-baseline-lb-1-092) and [here](https://www.kaggle.com/code/cdeotte/seasonal-model-with-validation-lb-1-091)).\n\n### Base model\nFor the base model, I mostly adopted the preprocessing (including outlier corrections), feature engineering and target transformation from Giba's notebook. I used a LightGBM model with a small number of trees (n_estimators=30) as the model since complex models tended to overfit quickly according to the validation results. The remaining settings were determined through experiments based on the validation score. \n- I didn't use a blacklist. \n- I tried several settings for outlier correction and the number of lag and window variables\n- I excluded cfips with less than 140 active values from models.\n\nThis model gives an upward trend for most cfips. As pointed out in various notebooks, microbusiness density showed a global upward trend, so I believe this model roughly captures that trend.\n\n### Adhoc rules\nI implemented two types of rule-based adjustments: trend-based and seasonal effects. These adjustments exclude cfips with low active values. For trend-based adjustments, I prepared rules such as \"For cfips that have increased 1+x times in the last n months (or n-1 months), the average of the growth rate is multiplied by 1-y to obtain the new growth rate.\" Since applying the same rule repeatedly up to 5 months ahead often leads to overfitting, my adjustments become more conservative for farther predictions. For example, when creating the May 2023 prediction from the April 2023 prediction, trend-based adjustments are hardly applied.\n\nRegarding seasonal effects, I assumed effects based on months and prepared rules such as \"For cfips that have  increased by 1+x times or more compared to the previous month every time in the same month in the past, the average of the growth rate is multiplied by 1-y to obtain the new growth rate.\" It might be difficult to obtain conclusive evidence of the monthly effects based on the training data alone, but considering that what we want to predict is the economic index and validation scores were improved by this rule , I assumed their existence.  \n\nIn these rule-based adjustments, I implemented both upward and downward adjustments. However, considering the property of SMAPE, where downward deviations are less desirable than upward deviations, I made aggressive adjustments in the upward direction and conservative adjustments in the downward direction. In case of overlapping adjustments, I took the average. The threshold and detailed settings of the rules were determined through experiments based on the validation score.\n\n# Getting predictions and creating submission files\nTo get predictions, I used the best score from the Public Notebook as the starting point for the January 2023 prediction and incorporated the results of Public LB probing. The Public LB probing consists in the same rule-based approach described above. I applied multiple adjustments for both long-term and short-term trends in addition to seasonal effects. Using the obtained January 2023 prediction as the starting point, I made predictions up to May 2023 by repeating the 1-month ahead forecast. I also applied adjustments shown in [Vitaly Kudelya's notebook](https://www.kaggle.com/code/vitalykudelya/use-discrete-nature-of-microbusiness-density) to the obtained predictions.\nWe can submit two files as final submission. For one submission, I submitted the prediction where rule-based adjustments were aggressive, and for the other submission I submitted the prediction where rule-based adjustments were modest. As a result, the former one was better than the latter one, which held also in validation scores.\n\n# Acknowledgements\nMost of the basic ideas were fairly simple and derived from public notebooks. Setting up appropriate validations was cumbersome, but by attempting the combinations of these ideas based on the validation scores, I was able to achieve this rank. Thanks to Kagglers for many thoughtful and helpful notebooks and discussions. In competitions like this one, where the Public LB and Private LB data differ significantly, it can be difficult to determine what to trust, but preparing reliable validation is crucial above all else. My code is available at [github](https://github.com/KazuakiTokunaga/kaggle-godaddy). ",
      "votes": 3
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T19:29:53Z",
  "competition_id": 41881,
  "competition_slug": "godaddy-microbusiness-density-forecasting",
  "team_id": 9667669,
  "solution_url": "/competitions/godaddy-microbusiness-density-forecasting/writeups/kazuaki-tokunaga-99th-place-solution-lightgbm-and-"
}