{
  "id": 274661,
  "title": "2nd Place Solution",
  "url": "/competitions/mlb-player-digital-engagement-forecasting/writeups/automlb-2nd-place-solution",
  "author_name": "",
  "post_date": "2021-09-27T08:01:26.703Z",
  "votes": 14,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Our final model was a blend of 6 GBM models (5 Lightgbm, 1 Xgboost) all trained on the same features. We validated on the last month of data and then retrained the model on the entire dataset.</p>\n<ul>\n<li>LightGBM - objective=”regression_l1”</li>\n<li>LightGBM - objective=”regression_l2” - targets scaled by double square root</li>\n<li>LightGBM - objective=”regression_l1” - boost_from_average=True</li>\n<li>LightGBM - objective=”regression_l1”, 'max_depth': -1</li>\n<li>LightGBM DART - object=’regression_l1’, boosting=’dart’</li>\n<li>Xgboost - targets scaled by double square root</li>\n</ul>\n<p>Our final feature set had over 1000 features that pretty fell under 3 categories:</p>\n<ul>\n<li>Target aggregates - All-time and rolling 12-month historical mean/variance of target for each player.</li>\n<li>Last 20 days/games of various stats for each player. For example, <code>strikeouts_1_day_ago</code>, <code>strikeouts_2_days_ago</code>, …, <code>strikeouts_20_days_ago</code> for each player. </li>\n<li>Features based on our baseball knowledge/what gets people to tweet. For example, a walk-off hit/home run will often trigger some engagement. Other features were no-hitters, win probability added by a player (a proxy for if they played a good game or were involved in \"high leverage\" plays), ranking in the home run race, was a player ejected, ERA and ERA ranking, and more.</li>\n</ul>\n<p>Some of our most important features were:</p>\n<ul>\n<li>numberOfFollowers - most recent value for a players number of Twitter followers</li>\n<li>numberOfFollower_delta - the change in Twitter followers between the most recent 2 months</li>\n<li>monthday - integer value representing current month and day (mmdd) e.g. June 4th would have a value of <code>604</code>.</li>\n<li>{target}_p_var - Historical variance of {target} for player</li>\n<li>{target}_p_gameday_mean - Historical mean of {target} for player on gamedays</li>\n<li>roll12_{target}_p_mean - {target} mean for player for the previous 12 months</li>\n<li>roll12_{target}_p_var - {target} variance for player for the previous 12 months</li>\n<li>wpa_daily_max - League-wide daily maximum value of Win Probability Added. An approximate (exact base-out states are not available, so calculation is approximate) WPA value is calculated for each player. </li>\n<li>homeRuns_rank - Players’ home run ranking </li>\n<li>walk_off_league - Was there a walk off hit in the league that day?</li>\n<li>days_since_last_start - number of days since a player last pitched. Useful for the model to learn if a player is likely to pitch on the day engagement is measured.</li>\n</ul>\n<p>Submission Notebook: <a href=\"https://www.kaggle.com/brandenkmurray/mlb-predict-final\" target=\"_blank\">https://www.kaggle.com/brandenkmurray/mlb-predict-final</a></p>",
  "messages": [
    {
      "id": "1525183",
      "postDate": "09/27/2021 07:56:24",
      "content": "<p>Our final model was a blend of 6 GBM models (5 Lightgbm, 1 Xgboost) all trained on the same features. We validated on the last month of data and then retrained the model on the entire dataset.</p>\n<ul>\n<li>LightGBM - objective=”regression_l1”</li>\n<li>LightGBM - objective=”regression_l2” - targets scaled by double square root</li>\n<li>LightGBM - objective=”regression_l1” - boost_from_average=True</li>\n<li>LightGBM - objective=”regression_l1”, 'max_depth': -1</li>\n<li>LightGBM DART - object=’regression_l1’, boosting=’dart’</li>\n<li>Xgboost - targets scaled by double square root</li>\n</ul>\n<p>Our final feature set had over 1000 features that pretty fell under 3 categories:</p>\n<ul>\n<li>Target aggregates - All-time and rolling 12-month historical mean/variance of target for each player.</li>\n<li>Last 20 days/games of various stats for each player. For example, <code>strikeouts_1_day_ago</code>, <code>strikeouts_2_days_ago</code>, …, <code>strikeouts_20_days_ago</code> for each player. </li>\n<li>Features based on our baseball knowledge/what gets people to tweet. For example, a walk-off hit/home run will often trigger some engagement. Other features were no-hitters, win probability added by a player (a proxy for if they played a good game or were involved in \"high leverage\" plays), ranking in the home run race, was a player ejected, ERA and ERA ranking, and more.</li>\n</ul>\n<p>Some of our most important features were:</p>\n<ul>\n<li>numberOfFollowers - most recent value for a players number of Twitter followers</li>\n<li>numberOfFollower_delta - the change in Twitter followers between the most recent 2 months</li>\n<li>monthday - integer value representing current month and day (mmdd) e.g. June 4th would have a value of <code>604</code>.</li>\n<li>{target}_p_var - Historical variance of {target} for player</li>\n<li>{target}_p_gameday_mean - Historical mean of {target} for player on gamedays</li>\n<li>roll12_{target}_p_mean - {target} mean for player for the previous 12 months</li>\n<li>roll12_{target}_p_var - {target} variance for player for the previous 12 months</li>\n<li>wpa_daily_max - League-wide daily maximum value of Win Probability Added. An approximate (exact base-out states are not available, so calculation is approximate) WPA value is calculated for each player. </li>\n<li>homeRuns_rank - Players’ home run ranking </li>\n<li>walk_off_league - Was there a walk off hit in the league that day?</li>\n<li>days_since_last_start - number of days since a player last pitched. Useful for the model to learn if a player is likely to pitch on the day engagement is measured.</li>\n</ul>\n<p>Submission Notebook: <a href=\"https://www.kaggle.com/brandenkmurray/mlb-predict-final\" target=\"_blank\">https://www.kaggle.com/brandenkmurray/mlb-predict-final</a></p>",
      "rawMarkdown": "Our final model was a blend of 6 GBM models (5 Lightgbm, 1 Xgboost) all trained on the same features. We validated on the last month of data and then retrained the model on the entire dataset.\n\n- LightGBM - objective=”regression_l1”\n- LightGBM - objective=”regression_l2” - targets scaled by double square root\n- LightGBM - objective=”regression_l1” - boost_from_average=True\n- LightGBM - objective=”regression_l1”, 'max_depth': -1\n- LightGBM DART - object=’regression_l1’, boosting=’dart’\n- Xgboost - targets scaled by double square root\n\nOur final feature set had over 1000 features that pretty fell under 3 categories:\n\n- Target aggregates - All-time and rolling 12-month historical mean/variance of target for each player.\n- Last 20 days/games of various stats for each player. For example, `strikeouts_1_day_ago`, `strikeouts_2_days_ago`, ..., `strikeouts_20_days_ago` for each player. \n- Features based on our baseball knowledge/what gets people to tweet. For example, a walk-off hit/home run will often trigger some engagement. Other features were no-hitters, win probability added by a player (a proxy for if they played a good game or were involved in \"high leverage\" plays), ranking in the home run race, was a player ejected, ERA and ERA ranking, and more.\n\n\nSome of our most important features were:\n- numberOfFollowers - most recent value for a players number of Twitter followers\n- numberOfFollower_delta - the change in Twitter followers between the most recent 2 months\n- monthday - integer value representing current month and day (mmdd) e.g. June 4th would have a value of `604`.\n- {target}_p_var - Historical variance of {target} for player\n- {target}_p_gameday_mean - Historical mean of {target} for player on gamedays\n- roll12_{target}_p_mean - {target} mean for player for the previous 12 months\n- roll12_{target}_p_var - {target} variance for player for the previous 12 months\n- wpa_daily_max - League-wide daily maximum value of Win Probability Added. An approximate (exact base-out states are not available, so calculation is approximate) WPA value is calculated for each player. \n- homeRuns_rank - Players’ home run ranking \n- walk_off_league - Was there a walk off hit in the league that day?\n- days_since_last_start - number of days since a player last pitched. Useful for the model to learn if a player is likely to pitch on the day engagement is measured.\n\nSubmission Notebook: https://www.kaggle.com/brandenkmurray/mlb-predict-final",
      "votes": null
    },
    {
      "id": "1525804",
      "postDate": "09/27/2021 16:32:28",
      "content": "<p>Congrats and thanks for sharing! I had tried numberOfFollowers, numberOfFollowers_delta, monthday and they were not useful for me when I add these features to my existing pipeline. What kind of feature importance do you mean when you say these were the most important features?</p>\n<p>I think league-wise features might have made the difference.</p>",
      "rawMarkdown": "Congrats and thanks for sharing! I had tried numberOfFollowers, numberOfFollowers_delta, monthday and they were not useful for me when I add these features to my existing pipeline. What kind of feature importance do you mean when you say these were the most important features?\n\nI think league-wise features might have made the difference.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1525804,
      "author_name": "aerdem4",
      "author_url": "",
      "post_date": "09/27/2021 16:32:28",
      "content": "<p>Congrats and thanks for sharing! I had tried numberOfFollowers, numberOfFollowers_delta, monthday and they were not useful for me when I add these features to my existing pipeline. What kind of feature importance do you mean when you say these were the most important features?</p>\n<p>I think league-wise features might have made the difference.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1525183": "Our final model was a blend of 6 GBM models (5 Lightgbm, 1 Xgboost) all trained on the same features. We validated on the last month of data and then retrained the model on the entire dataset.\n\n- LightGBM - objective=”regression_l1”\n- LightGBM - objective=”regression_l2” - targets scaled by double square root\n- LightGBM - objective=”regression_l1” - boost_from_average=True\n- LightGBM - objective=”regression_l1”, 'max_depth': -1\n- LightGBM DART - object=’regression_l1’, boosting=’dart’\n- Xgboost - targets scaled by double square root\n\nOur final feature set had over 1000 features that pretty fell under 3 categories:\n\n- Target aggregates - All-time and rolling 12-month historical mean/variance of target for each player.\n- Last 20 days/games of various stats for each player. For example, `strikeouts_1_day_ago`, `strikeouts_2_days_ago`, ..., `strikeouts_20_days_ago` for each player. \n- Features based on our baseball knowledge/what gets people to tweet. For example, a walk-off hit/home run will often trigger some engagement. Other features were no-hitters, win probability added by a player (a proxy for if they played a good game or were involved in \"high leverage\" plays), ranking in the home run race, was a player ejected, ERA and ERA ranking, and more.\n\n\nSome of our most important features were:\n- numberOfFollowers - most recent value for a players number of Twitter followers\n- numberOfFollower_delta - the change in Twitter followers between the most recent 2 months\n- monthday - integer value representing current month and day (mmdd) e.g. June 4th would have a value of `604`.\n- {target}_p_var - Historical variance of {target} for player\n- {target}_p_gameday_mean - Historical mean of {target} for player on gamedays\n- roll12_{target}_p_mean - {target} mean for player for the previous 12 months\n- roll12_{target}_p_var - {target} variance for player for the previous 12 months\n- wpa_daily_max - League-wide daily maximum value of Win Probability Added. An approximate (exact base-out states are not available, so calculation is approximate) WPA value is calculated for each player. \n- homeRuns_rank - Players’ home run ranking \n- walk_off_league - Was there a walk off hit in the league that day?\n- days_since_last_start - number of days since a player last pitched. Useful for the model to learn if a player is likely to pitch on the day engagement is measured.\n\nSubmission Notebook: https://www.kaggle.com/brandenkmurray/mlb-predict-final",
    "1525804": "Congrats and thanks for sharing! I had tried numberOfFollowers, numberOfFollowers_delta, monthday and they were not useful for me when I add these features to my existing pipeline. What kind of feature importance do you mean when you say these were the most important features?\n\nI think league-wise features might have made the difference."
  },
  "source": "meta"
}