{
  "id": 394821,
  "title": "My Forecasting Strategy",
  "content": "<h1>Trend</h1>\n<p>My cross-validation didn't show that complicated gradient boostings showed significantly better results than simple approaches. Also for some months  gradient boostings performed worse than the Last Value baseline and simple approaches showed more stable performance. </p>\n<p>The following formula shows how I estimated trend for cfips.<br>\n<code>active_quantile_group_21_last_6m_trend</code> means the best multiplication constant (clipped from 1 to 1.006) for the last value of <code>microbusiness_density</code> for the next month on a previous 6 month for a group of cfips (total 21 groups by quantile of active). The same logic for <code>state</code> and concrete <code>cfips</code> group.<br>\n<code>forward_2</code> means the best multiplication constant for the next 2 month (clipped from 1 to 1.012).</p>\n<pre><code>df_features_data[] = (\n    df_features_data[] * \n    + df_features_data[] * \n    + df_features_data[] *  + df_features_data[] * \n    + df_features_data[] *  + df_features_data[] * \n) *  + ((\n    df_features_data[] * \n    + df_features_data[] * \n    + df_features_data[] * \n)**) * \n</code></pre>\n<h1>Using the best public submission as a starting point for predictions</h1>\n<p>Public Leaderboard data wasn't published and for time-series data it should be beneficial to use the best public submission.</p>\n<h1>Select 2 Submissions. Positive and Negative</h1>\n<p>It's a good idea to cover different scenarios selecting 2 submissions. I call it Positive submission (we under-forecasting trend) and negative (we over-forecasting trend). <br>\nFor example for Positive submission <code>* (trend + 0.0005)**(month_number)</code></p>\n<h1>May Seasonality</h1>\n<p>I just used forecast for April <code>* (1 - 0.0025)</code> for Positive submission, because May showed a dropdown of values the last two years.</p>\n<h1>Cfips with active &lt; 150</h1>\n<p>My cross-validation showed that using the last value baseline for such cfips (as many public baselines do) is good only for one month forward forecast, for March, April, May i used some multiplication constants.<br>\nThe following plot shows that for active &lt; 75 using the last value baseline for 3 month forecast is the best, for 75-150 it's better to use trend.\n <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F297456%2F7059d3c2b37887d58d0ae4b88dd4cb4d%2Fnewplot%20(98).png?generation=1678841088819412&amp;alt=media\" alt=\"\"></p>\n<h1>Hope that random helps 🤞</h1>",
  "comments": [
    {
      "id": 2182414,
      "author_name": "Shiner",
      "author_url": "",
      "post_date": "2023-03-15T05:15:25.890000",
      "content": "<p>I used a similar <a href=\"https://www.kaggle.com/competitions/godaddy-microbusiness-density-forecasting/discussion/394855\" target=\"_blank\">method</a>, differentiate trend and somehow other information. <br>\nAlso I manually revised some months in my submission.</p>\n<pre><code>revised = [(over_high_0005,-0.005),(over_high_001,-0.01),(over_high_002,-0.02),(over_high_003,-0.03),(over_high_004,-0.04),(over_low_001,0.01),(over_low_002,0.02),(over_low_003,0.03),(over_low_004,0.04)]\nremain_last = remain_last\nremain_idx = (submission.cfips.isin(remain_last))&amp;(submission.time.isin(['2023-03-01','2023-04-01','2023-05-01']))\n</code></pre>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2182160,
      "author_name": "Kevin Morgado",
      "author_url": "",
      "post_date": "2023-03-15T01:20:36.343000",
      "content": "<p>Thanks for your insights <a href=\"https://www.kaggle.com/vitalykudelya\" target=\"_blank\">@vitalykudelya</a>. It is very interesting to see how the seasonality approaches affect the submission score.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2182283,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-03-15T03:29:28.033000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "comment_count": 3,
  "messages": [
    {
      "id": 2182137,
      "postDate": "2023-03-15T00:53:24.447Z",
      "content": "<h1>Trend</h1>\n<p>My cross-validation didn't show that complicated gradient boostings showed significantly better results than simple approaches. Also for some months  gradient boostings performed worse than the Last Value baseline and simple approaches showed more stable performance. </p>\n<p>The following formula shows how I estimated trend for cfips.<br>\n<code>active_quantile_group_21_last_6m_trend</code> means the best multiplication constant (clipped from 1 to 1.006) for the last value of <code>microbusiness_density</code> for the next month on a previous 6 month for a group of cfips (total 21 groups by quantile of active). The same logic for <code>state</code> and concrete <code>cfips</code> group.<br>\n<code>forward_2</code> means the best multiplication constant for the next 2 month (clipped from 1 to 1.012).</p>\n<pre><code>df_features_data[] = (\n    df_features_data[] * \n    + df_features_data[] * \n    + df_features_data[] *  + df_features_data[] * \n    + df_features_data[] *  + df_features_data[] * \n) *  + ((\n    df_features_data[] * \n    + df_features_data[] * \n    + df_features_data[] * \n)**) * \n</code></pre>\n<h1>Using the best public submission as a starting point for predictions</h1>\n<p>Public Leaderboard data wasn't published and for time-series data it should be beneficial to use the best public submission.</p>\n<h1>Select 2 Submissions. Positive and Negative</h1>\n<p>It's a good idea to cover different scenarios selecting 2 submissions. I call it Positive submission (we under-forecasting trend) and negative (we over-forecasting trend). <br>\nFor example for Positive submission <code>* (trend + 0.0005)**(month_number)</code></p>\n<h1>May Seasonality</h1>\n<p>I just used forecast for April <code>* (1 - 0.0025)</code> for Positive submission, because May showed a dropdown of values the last two years.</p>\n<h1>Cfips with active &lt; 150</h1>\n<p>My cross-validation showed that using the last value baseline for such cfips (as many public baselines do) is good only for one month forward forecast, for March, April, May i used some multiplication constants.<br>\nThe following plot shows that for active &lt; 75 using the last value baseline for 3 month forecast is the best, for 75-150 it's better to use trend.\n <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F297456%2F7059d3c2b37887d58d0ae4b88dd4cb4d%2Fnewplot%20(98).png?generation=1678841088819412&amp;alt=media\" alt=\"\"></p>\n<h1>Hope that random helps 🤞</h1>",
      "rawMarkdown": "# Trend\nMy cross-validation didn't show that complicated gradient boostings showed significantly better results than simple approaches. Also for some months  gradient boostings performed worse than the Last Value baseline and simple approaches showed more stable performance. \n\nThe following formula shows how I estimated trend for cfips.\n`active_quantile_group_21_last_6m_trend` means the best multiplication constant (clipped from 1 to 1.006) for the last value of `microbusiness_density` for the next month on a previous 6 month for a group of cfips (total 21 groups by quantile of active). The same logic for `state` and concrete `cfips` group.\n`forward_2` means the best multiplication constant for the next 2 month (clipped from 1 to 1.012).\n\n```python\ndf_features_data['trend'] = (\n    df_features_data['active_quantile_group_21_last_6m_trend'] * 0.16\n    + df_features_data['active_quantile_group_21_last_3m_trend'] * 0.16\n    + df_features_data['state_last_6m_trend'] * 0.14 + df_features_data['state_last_3m_trend'] * 0.14\n    + df_features_data['cfips_last_6m_trend'] * 0.20 + df_features_data['cfips_last_3m_trend'] * 0.20\n) * 0.5 + ((\n    df_features_data['active_quantile_group_21_last_6m_trend_forward_2'] * 0.4\n    + df_features_data['state_last_6m_trend_forward_2'] * 0.4\n    + df_features_data['cfips_last_6m_trend_forward_2'] * 0.2\n)**0.5) * 0.5\n```\n\n# Using the best public submission as a starting point for predictions\nPublic Leaderboard data wasn't published and for time-series data it should be beneficial to use the best public submission.\n\n# Select 2 Submissions. Positive and Negative\nIt's a good idea to cover different scenarios selecting 2 submissions. I call it Positive submission (we under-forecasting trend) and negative (we over-forecasting trend). \nFor example for Positive submission `* (trend + 0.0005)**(month_number)`\n\n# May Seasonality\nI just used forecast for April `* (1 - 0.0025)` for Positive submission, because May showed a dropdown of values the last two years.\n\n# Cfips with active < 150\nMy cross-validation showed that using the last value baseline for such cfips (as many public baselines do) is good only for one month forward forecast, for March, April, May i used some multiplication constants.\nThe following plot shows that for active < 75 using the last value baseline for 3 month forecast is the best, for 75-150 it's better to use trend.\n ![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F297456%2F7059d3c2b37887d58d0ae4b88dd4cb4d%2Fnewplot%20(98).png?generation=1678841088819412&alt=media)\n\n# Hope that random helps 🤞",
      "votes": 19
    },
    {
      "id": 2182414,
      "postDate": "2023-03-15T05:15:25.890Z",
      "content": "<p>I used a similar <a href=\"https://www.kaggle.com/competitions/godaddy-microbusiness-density-forecasting/discussion/394855\" target=\"_blank\">method</a>, differentiate trend and somehow other information. <br>\nAlso I manually revised some months in my submission.</p>\n<pre><code>revised = [(over_high_0005,-0.005),(over_high_001,-0.01),(over_high_002,-0.02),(over_high_003,-0.03),(over_high_004,-0.04),(over_low_001,0.01),(over_low_002,0.02),(over_low_003,0.03),(over_low_004,0.04)]\nremain_last = remain_last\nremain_idx = (submission.cfips.isin(remain_last))&amp;(submission.time.isin(['2023-03-01','2023-04-01','2023-05-01']))\n</code></pre>",
      "rawMarkdown": "I used a similar [method](https://www.kaggle.com/competitions/godaddy-microbusiness-density-forecasting/discussion/394855), differentiate trend and somehow other information. \nAlso I manually revised some months in my submission.\n\n```\nrevised = [(over_high_0005,-0.005),(over_high_001,-0.01),(over_high_002,-0.02),(over_high_003,-0.03),(over_high_004,-0.04),(over_low_001,0.01),(over_low_002,0.02),(over_low_003,0.03),(over_low_004,0.04)]\nremain_last = remain_last\nremain_idx = (submission.cfips.isin(remain_last))&(submission.time.isin(['2023-03-01','2023-04-01','2023-05-01']))\n```\n\n\n\n"
    },
    {
      "id": 2182160,
      "postDate": "2023-03-15T01:20:36.343Z",
      "content": "<p>Thanks for your insights <a href=\"https://www.kaggle.com/vitalykudelya\" target=\"_blank\">@vitalykudelya</a>. It is very interesting to see how the seasonality approaches affect the submission score.</p>",
      "rawMarkdown": "Thanks for your insights @vitalykudelya. It is very interesting to see how the seasonality approaches affect the submission score."
    },
    {
      "id": 2182283,
      "postDate": "2023-03-15T03:29:28.033Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-19T19:27:13Z",
  "competition_id": 41881,
  "competition_slug": "godaddy-microbusiness-density-forecasting",
  "team_id": 9856709,
  "solution_url": "/competitions/godaddy-microbusiness-density-forecasting/writeups/vitaly-kudelya-my-forecasting-strategy"
}