{
  "id": 417946,
  "title": "Public 1125 - > Private 48 solution",
  "content": "<p>Methods that are beneficial for prediction:</p>\n<p>Outlier smoothing<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5998972%2Fbc31d3c4fcf04c23e7afb091f931984b%2F1.png?generation=1687061025743863&amp;alt=media\" alt=\"\"><br>\nCoefficient adjustment + approximation<br>\nactive: The raw count of microbusinesses in the county The target to be predicted is population density = active / population. The population statistics change every January. The competition requires predicting the population density in 2023, which has changed in the denominator of population density. Based on the existing data, use (2023 predicted value * 2020 population) / 2021 population to estimate the coefficient of population trend change, and then correct the predicted value with this coefficient. Because the numerator part active is originally an integer, the predicted value multiplied by the population is usually a continuous value, such as 1.3, while the actual value may be 1, and rounding can help increase accuracy. The predicted value after coefficient correction should be multiplied by the 2021 population, then rounded, and then divided by the 2021 population for further correction.</p>\n<p>Optimal shift time = 12<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5998972%2Fc78306ebaa11dbf3adbc2c6a1d6a1b62%2F2.png?generation=1687061119239898&amp;alt=media\" alt=\"\"><br>\nCreate lagged features for the past 12 months, if it is 24 or 6, it will make the effect worse, especially 24.</p>\n<p>The state and county fields are label encoded, plus the cfips field (equivalent to state + county), which are beneficial for the prediction results. <br>\nRate of change effect is better<br>\nFor predicting n + gap tasks, change the original density continuous value to be predicted to the growth value between the current value and the previous gap months.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5998972%2F9c4f2fa8203de8a5e29cc538e1dfccb8%2F3.png?generation=1687061133256397&amp;alt=media\" alt=\"\"><br>\nMake some lagged features for the original density continuous value, and then add some lagged features for this growth value, which improves the prediction accuracy</p>\n<p>After converting the density target value into a growth value, LightGbm and Xgboost models need to change the default objective parameter and use pseudo huber loss as the optimization indicator.</p>\n<p>========</p>\n<p>对预测有增益的方法：</p>\n<h1>异常值平滑</h1>\n<h1>系数调整 + 求近似值</h1>\n<p>active：The raw count of microbusinesses in the county<br>\n要预测的目标为人口密度 = active / 人口。 人口统计值每年一月会发生变化。竞赛要预测2023年的人口密度，在人口密度分母上已经发生了变化。基于已有的数据，使用（2023年预测值 * 2020年人口）/ 2021年人口 估算出人口趋势变化的系数，再将该系数修正预测值。<br>\n因为分子部分active本来是整数，预测值乘以人口通常是连续值，譬如1.3，而实际值可能是1，取整后可以帮助精度增加。系数修正后的预测值要乘以2021年人口，然后取整，再除以2021年人口，做进一步修正。</p>\n<h1>最优shift time = 12</h1>\n<p>创建过去12个月的滞后特征，如果是24或者6，都会让效果变差，尤其是24.</p>\n<h1>state和county两个字段做label encoding，加上cfips（等同于state + county）字段，都对预测结果有增益。</h1>\n<h1>rate of change 效果变好</h1>\n<p>1.预测n + gap的任务，将原本要预测的密度连续值， 改成当前值与上gap个月的增长值。</p>\n<p>2.对原本对密度连续值做一些滞后特征，再加上对该增长值做滞后特征，对预测准度有提升<br>\n3.将密度目标值转换成增长值后，LightGbm和Xgboost模型需要更改默认的objective参数，使用pseudo huber loss作为优化指标.</p>",
  "comments": [
    {
      "id": 2318457,
      "author_name": "RogerOcean",
      "author_url": "",
      "post_date": "2023-06-26T11:28:59.863000",
      "content": "<p>thanks for sharing, seeing Chinese is very friendly😁</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2317342,
      "author_name": "Hongrui Fu",
      "author_url": "",
      "post_date": "2023-06-25T16:06:47.160000",
      "content": "<p>感谢你的贡献，十分高兴能看见附有中文的解答</p>",
      "votes": 1,
      "replies": []
    }
  ],
  "comment_count": 2,
  "messages": [
    {
      "id": 2307266,
      "postDate": "2023-06-18T04:08:22.480Z",
      "content": "<p>Methods that are beneficial for prediction:</p>\n<p>Outlier smoothing<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5998972%2Fbc31d3c4fcf04c23e7afb091f931984b%2F1.png?generation=1687061025743863&amp;alt=media\" alt=\"\"><br>\nCoefficient adjustment + approximation<br>\nactive: The raw count of microbusinesses in the county The target to be predicted is population density = active / population. The population statistics change every January. The competition requires predicting the population density in 2023, which has changed in the denominator of population density. Based on the existing data, use (2023 predicted value * 2020 population) / 2021 population to estimate the coefficient of population trend change, and then correct the predicted value with this coefficient. Because the numerator part active is originally an integer, the predicted value multiplied by the population is usually a continuous value, such as 1.3, while the actual value may be 1, and rounding can help increase accuracy. The predicted value after coefficient correction should be multiplied by the 2021 population, then rounded, and then divided by the 2021 population for further correction.</p>\n<p>Optimal shift time = 12<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5998972%2Fc78306ebaa11dbf3adbc2c6a1d6a1b62%2F2.png?generation=1687061119239898&amp;alt=media\" alt=\"\"><br>\nCreate lagged features for the past 12 months, if it is 24 or 6, it will make the effect worse, especially 24.</p>\n<p>The state and county fields are label encoded, plus the cfips field (equivalent to state + county), which are beneficial for the prediction results. <br>\nRate of change effect is better<br>\nFor predicting n + gap tasks, change the original density continuous value to be predicted to the growth value between the current value and the previous gap months.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5998972%2F9c4f2fa8203de8a5e29cc538e1dfccb8%2F3.png?generation=1687061133256397&amp;alt=media\" alt=\"\"><br>\nMake some lagged features for the original density continuous value, and then add some lagged features for this growth value, which improves the prediction accuracy</p>\n<p>After converting the density target value into a growth value, LightGbm and Xgboost models need to change the default objective parameter and use pseudo huber loss as the optimization indicator.</p>\n<p>========</p>\n<p>对预测有增益的方法：</p>\n<h1>异常值平滑</h1>\n<h1>系数调整 + 求近似值</h1>\n<p>active：The raw count of microbusinesses in the county<br>\n要预测的目标为人口密度 = active / 人口。 人口统计值每年一月会发生变化。竞赛要预测2023年的人口密度，在人口密度分母上已经发生了变化。基于已有的数据，使用（2023年预测值 * 2020年人口）/ 2021年人口 估算出人口趋势变化的系数，再将该系数修正预测值。<br>\n因为分子部分active本来是整数，预测值乘以人口通常是连续值，譬如1.3，而实际值可能是1，取整后可以帮助精度增加。系数修正后的预测值要乘以2021年人口，然后取整，再除以2021年人口，做进一步修正。</p>\n<h1>最优shift time = 12</h1>\n<p>创建过去12个月的滞后特征，如果是24或者6，都会让效果变差，尤其是24.</p>\n<h1>state和county两个字段做label encoding，加上cfips（等同于state + county）字段，都对预测结果有增益。</h1>\n<h1>rate of change 效果变好</h1>\n<p>1.预测n + gap的任务，将原本要预测的密度连续值， 改成当前值与上gap个月的增长值。</p>\n<p>2.对原本对密度连续值做一些滞后特征，再加上对该增长值做滞后特征，对预测准度有提升<br>\n3.将密度目标值转换成增长值后，LightGbm和Xgboost模型需要更改默认的objective参数，使用pseudo huber loss作为优化指标.</p>",
      "rawMarkdown": "Methods that are beneficial for prediction:\n\nOutlier smoothing\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5998972%2Fbc31d3c4fcf04c23e7afb091f931984b%2F1.png?generation=1687061025743863&alt=media)\nCoefficient adjustment + approximation\nactive: The raw count of microbusinesses in the county The target to be predicted is population density = active / population. The population statistics change every January. The competition requires predicting the population density in 2023, which has changed in the denominator of population density. Based on the existing data, use (2023 predicted value * 2020 population) / 2021 population to estimate the coefficient of population trend change, and then correct the predicted value with this coefficient. Because the numerator part active is originally an integer, the predicted value multiplied by the population is usually a continuous value, such as 1.3, while the actual value may be 1, and rounding can help increase accuracy. The predicted value after coefficient correction should be multiplied by the 2021 population, then rounded, and then divided by the 2021 population for further correction.\n\nOptimal shift time = 12\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5998972%2Fc78306ebaa11dbf3adbc2c6a1d6a1b62%2F2.png?generation=1687061119239898&alt=media)\nCreate lagged features for the past 12 months, if it is 24 or 6, it will make the effect worse, especially 24.\n\nThe state and county fields are label encoded, plus the cfips field (equivalent to state + county), which are beneficial for the prediction results. \nRate of change effect is better\nFor predicting n + gap tasks, change the original density continuous value to be predicted to the growth value between the current value and the previous gap months.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5998972%2F9c4f2fa8203de8a5e29cc538e1dfccb8%2F3.png?generation=1687061133256397&alt=media)\nMake some lagged features for the original density continuous value, and then add some lagged features for this growth value, which improves the prediction accuracy\n\nAfter converting the density target value into a growth value, LightGbm and Xgboost models need to change the default objective parameter and use pseudo huber loss as the optimization indicator.\n\n\n========\n\n对预测有增益的方法：\n# 异常值平滑\n\n\n# 系数调整 + 求近似值\nactive：The raw count of microbusinesses in the county\n要预测的目标为人口密度 = active / 人口。 人口统计值每年一月会发生变化。竞赛要预测2023年的人口密度，在人口密度分母上已经发生了变化。基于已有的数据，使用（2023年预测值 * 2020年人口）/ 2021年人口 估算出人口趋势变化的系数，再将该系数修正预测值。\n因为分子部分active本来是整数，预测值乘以人口通常是连续值，譬如1.3，而实际值可能是1，取整后可以帮助精度增加。系数修正后的预测值要乘以2021年人口，然后取整，再除以2021年人口，做进一步修正。\n\n# 最优shift time = 12\n\n创建过去12个月的滞后特征，如果是24或者6，都会让效果变差，尤其是24.\n# state和county两个字段做label encoding，加上cfips（等同于state + county）字段，都对预测结果有增益。\n# rate of change 效果变好\n1.预测n + gap的任务，将原本要预测的密度连续值， 改成当前值与上gap个月的增长值。\n\n2.对原本对密度连续值做一些滞后特征，再加上对该增长值做滞后特征，对预测准度有提升\n3.将密度目标值转换成增长值后，LightGbm和Xgboost模型需要更改默认的objective参数，使用pseudo huber loss作为优化指标.",
      "votes": 11
    },
    {
      "id": 2318457,
      "postDate": "2023-06-26T11:28:59.863Z",
      "content": "<p>thanks for sharing, seeing Chinese is very friendly😁</p>",
      "rawMarkdown": "thanks for sharing, seeing Chinese is very friendly😁",
      "votes": 1
    },
    {
      "id": 2317342,
      "postDate": "2023-06-25T16:06:47.160Z",
      "content": "<p>感谢你的贡献，十分高兴能看见附有中文的解答</p>",
      "rawMarkdown": "感谢你的贡献，十分高兴能看见附有中文的解答",
      "votes": 1
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T19:28:40Z",
  "competition_id": 41881,
  "competition_slug": "godaddy-microbusiness-density-forecasting",
  "team_id": 9917304,
  "solution_url": "/competitions/godaddy-microbusiness-density-forecasting/writeups/saic-ai-public-1125-private-48-solution"
}