{
  "id": 131650,
  "title": "Newbie Question about Ensembling",
  "url": "/competitions/cat-in-the-dat-ii/discussion/131650",
  "author_name": "",
  "post_date": "2020-02-20T19:12:30.177768300Z",
  "votes": 1,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Ensembling seems to be everywhere, and I feel like I have heard people use Gradient Boosting to ensemble models together. How does that work? (If that is a thing?) Right now I have just been building <code>n</code> models and then averaging their results together. Is there some reading that describes this method clearly and why it works? (if it is a method!)</p>",
  "messages": [
    {
      "id": "752151",
      "postDate": "02/20/2020 19:12:30",
      "content": "<p>Ensembling seems to be everywhere, and I feel like I have heard people use Gradient Boosting to ensemble models together. How does that work? (If that is a thing?) Right now I have just been building <code>n</code> models and then averaging their results together. Is there some reading that describes this method clearly and why it works? (if it is a method!)</p>",
      "rawMarkdown": "Ensembling seems to be everywhere, and I feel like I have heard people use Gradient Boosting to ensemble models together. How does that work? (If that is a thing?) Right now I have just been building `n` models and then averaging their results together. Is there some reading that describes this method clearly and why it works? (if it is a method!)",
      "votes": null
    },
    {
      "id": "752243",
      "postDate": "02/20/2020 19:59:46",
      "content": "<p>How's the Bias-Variance trade-off?\nWell, Weak Learners (United we Stand) =&gt; Stronger (Ensemble)\nSee if this helps:\n<a href=\"https://towardsdatascience.com/ensemble-methods-bagging-boosting-and-stacking-c9214a10a205\">https://towardsdatascience.com/ensemble-methods-bagging-boosting-and-stacking-c9214a10a205</a></p>\n\n<p>Let me know if you find anything else. Thanks. </p>",
      "rawMarkdown": "How's the Bias-Variance trade-off?\nWell, Weak Learners (United we Stand) =&gt; Stronger (Ensemble)\nSee if this helps:\nhttps://towardsdatascience.com/ensemble-methods-bagging-boosting-and-stacking-c9214a10a205\n\nLet me know if you find anything else. Thanks.",
      "votes": null
    },
    {
      "id": "752272",
      "postDate": "02/20/2020 20:37:45",
      "content": "<p>Glad you've asked, but first lets talk about two very popular ensemble methods, and YES there are more.</p>\n\n<ul>\n<li><strong>Bagging</strong>: Training a bunch of models in parallel on different subsets of data.</li>\n</ul>\n\n<p>That's basically what you're doing, another popular example would be Random forests where you train a bunch of decision tree models and perform a majority vote to make the final prediction.</p>\n\n<ul>\n<li><strong>Boosting</strong>: Training a bunch of models sequentially so that they learn from each other.</li>\n</ul>\n\n<p>And that's what you're asking about buddy. Now let me explain two popular methods:</p>\n\n<p><strong>AdaBoost or Adaptive Boosting</strong></p>\n\n<p>Lets keep decision trees as the basic model in mind, AdaBoost will learn by running decision trees on the full dataset sequentially where the weights of the ith model miss classified data points will be increased for the (i + 1)th model. This means it will be less likely for it to pick that wrong path to this miss classified data point again.</p>\n\n<p><strong>Gradient Boosting</strong></p>\n\n<p>And here we're with the one you're looking for. In contrast to AdaBoost, instead of updating the weights, the model learns from its predecessor's mistakes through looking directly at the residuals(Actual - Prediction). Not saying that's exactly how it is done but to give you an intuition lets say we've the following predictions [1, 2, 3, 4] where model A predicted [1,  2,  4, 3] with the residuals being [0, 0, -1, 1]. Model B comes to predict [1, 2, 4 ,3] but with the residuals added making it [1, 2, 3, 4].</p>\n\n<p>I hope I gave you the basic idea to motivate you to research forward! </p>\n\n<p>There are tons of great articles and videos you can reach via Google ;) </p>\n\n<p>If you've found this useful, please don't forget to up vote. Thank you :))</p>",
      "rawMarkdown": "Glad you've asked, but first lets talk about two very popular ensemble methods, and YES there are more.\n\n- **Bagging**: Training a bunch of models in parallel on different subsets of data.\n\nThat's basically what you're doing, another popular example would be Random forests where you train a bunch of decision tree models and perform a majority vote to make the final prediction.\n\n- **Boosting**: Training a bunch of models sequentially so that they learn from each other.\n\nAnd that's what you're asking about buddy. Now let me explain two popular methods:\n\n**AdaBoost or Adaptive Boosting**\n\nLets keep decision trees as the basic model in mind, AdaBoost will learn by running decision trees on the full dataset sequentially where the weights of the ith model miss classified data points will be increased for the (i + 1)th model. This means it will be less likely for it to pick that wrong path to this miss classified data point again.\n\n**Gradient Boosting**\n\nAnd here we're with the one you're looking for. In contrast to AdaBoost, instead of updating the weights, the model learns from its predecessor's mistakes through looking directly at the residuals(Actual - Prediction). Not saying that's exactly how it is done but to give you an intuition lets say we've the following predictions [1, 2, 3, 4] where model A predicted [1,  2,  4, 3] with the residuals being [0, 0, -1, 1]. Model B comes to predict [1, 2, 4 ,3] but with the residuals added making it [1, 2, 3, 4].\n\nI hope I gave you the basic idea to motivate you to research forward! \n\nThere are tons of great articles and videos you can reach via Google ;) \n\nIf you've found this useful, please don't forget to up vote. Thank you :))",
      "votes": null
    },
    {
      "id": "752283",
      "postDate": "02/20/2020 20:45:10",
      "content": "<p>Thank you for such a clear explanation! That helps immensely! So if I were to try to adapt AdaBoost to a fastai NN. Would I then do the following setup (for a two model setup):</p>\n\n<ol>\n<li>Train my base model</li>\n<li>For training and validation data calculate and include my residual</li>\n<li>Using the validation residual average, run said trained model on the test set (which now includes this residual)</li>\n</ol>\n\n<p>Is this a realistic understanding of that process? </p>",
      "rawMarkdown": "Thank you for such a clear explanation! That helps immensely! So if I were to try to adapt AdaBoost to a fastai NN. Would I then do the following setup (for a two model setup):\n\n1. Train my base model\n2. For training and validation data calculate and include my residual\n3. Using the validation residual average, run said trained model on the test set (which now includes this residual)\n\nIs this a realistic understanding of that process?",
      "votes": null
    },
    {
      "id": "752285",
      "postDate": "02/20/2020 20:45:33",
      "content": "<p>Thank you very much! This helped in making things clearer to me. </p>",
      "rawMarkdown": "Thank you very much! This helped in making things clearer to me.",
      "votes": null
    },
    {
      "id": "752915",
      "postDate": "02/21/2020 14:41:47",
      "content": "<p>Didn't quite get what you mean in step 3 but if your intention is to adapt AdaBoost to NNs then I suggest you give this <a href=\"http://www.iro.umontreal.ca/~lisa/pointeurs/ada-nc.pdf\">paper</a> a read. It's a great reference on the topic!</p>",
      "rawMarkdown": "Didn't quite get what you mean in step 3 but if your intention is to adapt AdaBoost to NNs then I suggest you give this [paper](http://www.iro.umontreal.ca/~lisa/pointeurs/ada-nc.pdf) a read. It's a great reference on the topic!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 752243,
      "author_name": "binaicrai",
      "author_url": "",
      "post_date": "02/20/2020 19:59:46",
      "content": "<p>How's the Bias-Variance trade-off?\nWell, Weak Learners (United we Stand) =&gt; Stronger (Ensemble)\nSee if this helps:\n<a href=\"https://towardsdatascience.com/ensemble-methods-bagging-boosting-and-stacking-c9214a10a205\">https://towardsdatascience.com/ensemble-methods-bagging-boosting-and-stacking-c9214a10a205</a></p>\n\n<p>Let me know if you find anything else. Thanks. </p>",
      "votes": null,
      "replies": [
        {
          "id": 752285,
          "author_name": "muellerzr",
          "author_url": "",
          "post_date": "02/20/2020 20:45:33",
          "content": "<p>Thank you very much! This helped in making things clearer to me. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 752272,
      "author_name": "msheriey",
      "author_url": "",
      "post_date": "02/20/2020 20:37:45",
      "content": "<p>Glad you've asked, but first lets talk about two very popular ensemble methods, and YES there are more.</p>\n\n<ul>\n<li><strong>Bagging</strong>: Training a bunch of models in parallel on different subsets of data.</li>\n</ul>\n\n<p>That's basically what you're doing, another popular example would be Random forests where you train a bunch of decision tree models and perform a majority vote to make the final prediction.</p>\n\n<ul>\n<li><strong>Boosting</strong>: Training a bunch of models sequentially so that they learn from each other.</li>\n</ul>\n\n<p>And that's what you're asking about buddy. Now let me explain two popular methods:</p>\n\n<p><strong>AdaBoost or Adaptive Boosting</strong></p>\n\n<p>Lets keep decision trees as the basic model in mind, AdaBoost will learn by running decision trees on the full dataset sequentially where the weights of the ith model miss classified data points will be increased for the (i + 1)th model. This means it will be less likely for it to pick that wrong path to this miss classified data point again.</p>\n\n<p><strong>Gradient Boosting</strong></p>\n\n<p>And here we're with the one you're looking for. In contrast to AdaBoost, instead of updating the weights, the model learns from its predecessor's mistakes through looking directly at the residuals(Actual - Prediction). Not saying that's exactly how it is done but to give you an intuition lets say we've the following predictions [1, 2, 3, 4] where model A predicted [1,  2,  4, 3] with the residuals being [0, 0, -1, 1]. Model B comes to predict [1, 2, 4 ,3] but with the residuals added making it [1, 2, 3, 4].</p>\n\n<p>I hope I gave you the basic idea to motivate you to research forward! </p>\n\n<p>There are tons of great articles and videos you can reach via Google ;) </p>\n\n<p>If you've found this useful, please don't forget to up vote. Thank you :))</p>",
      "votes": null,
      "replies": [
        {
          "id": 752283,
          "author_name": "muellerzr",
          "author_url": "",
          "post_date": "02/20/2020 20:45:10",
          "content": "<p>Thank you for such a clear explanation! That helps immensely! So if I were to try to adapt AdaBoost to a fastai NN. Would I then do the following setup (for a two model setup):</p>\n\n<ol>\n<li>Train my base model</li>\n<li>For training and validation data calculate and include my residual</li>\n<li>Using the validation residual average, run said trained model on the test set (which now includes this residual)</li>\n</ol>\n\n<p>Is this a realistic understanding of that process? </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 752915,
          "author_name": "msheriey",
          "author_url": "",
          "post_date": "02/21/2020 14:41:47",
          "content": "<p>Didn't quite get what you mean in step 3 but if your intention is to adapt AdaBoost to NNs then I suggest you give this <a href=\"http://www.iro.umontreal.ca/~lisa/pointeurs/ada-nc.pdf\">paper</a> a read. It's a great reference on the topic!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "752151": "Ensembling seems to be everywhere, and I feel like I have heard people use Gradient Boosting to ensemble models together. How does that work? (If that is a thing?) Right now I have just been building `n` models and then averaging their results together. Is there some reading that describes this method clearly and why it works? (if it is a method!)",
    "752243": "How's the Bias-Variance trade-off?\nWell, Weak Learners (United we Stand) =&gt; Stronger (Ensemble)\nSee if this helps:\nhttps://towardsdatascience.com/ensemble-methods-bagging-boosting-and-stacking-c9214a10a205\n\nLet me know if you find anything else. Thanks.",
    "752272": "Glad you've asked, but first lets talk about two very popular ensemble methods, and YES there are more.\n\n- **Bagging**: Training a bunch of models in parallel on different subsets of data.\n\nThat's basically what you're doing, another popular example would be Random forests where you train a bunch of decision tree models and perform a majority vote to make the final prediction.\n\n- **Boosting**: Training a bunch of models sequentially so that they learn from each other.\n\nAnd that's what you're asking about buddy. Now let me explain two popular methods:\n\n**AdaBoost or Adaptive Boosting**\n\nLets keep decision trees as the basic model in mind, AdaBoost will learn by running decision trees on the full dataset sequentially where the weights of the ith model miss classified data points will be increased for the (i + 1)th model. This means it will be less likely for it to pick that wrong path to this miss classified data point again.\n\n**Gradient Boosting**\n\nAnd here we're with the one you're looking for. In contrast to AdaBoost, instead of updating the weights, the model learns from its predecessor's mistakes through looking directly at the residuals(Actual - Prediction). Not saying that's exactly how it is done but to give you an intuition lets say we've the following predictions [1, 2, 3, 4] where model A predicted [1,  2,  4, 3] with the residuals being [0, 0, -1, 1]. Model B comes to predict [1, 2, 4 ,3] but with the residuals added making it [1, 2, 3, 4].\n\nI hope I gave you the basic idea to motivate you to research forward! \n\nThere are tons of great articles and videos you can reach via Google ;) \n\nIf you've found this useful, please don't forget to up vote. Thank you :))",
    "752283": "Thank you for such a clear explanation! That helps immensely! So if I were to try to adapt AdaBoost to a fastai NN. Would I then do the following setup (for a two model setup):\n\n1. Train my base model\n2. For training and validation data calculate and include my residual\n3. Using the validation residual average, run said trained model on the test set (which now includes this residual)\n\nIs this a realistic understanding of that process?",
    "752285": "Thank you very much! This helped in making things clearer to me.",
    "752915": "Didn't quite get what you mean in step 3 but if your intention is to adapt AdaBoost to NNs then I suggest you give this [paper](http://www.iro.umontreal.ca/~lisa/pointeurs/ada-nc.pdf) a read. It's a great reference on the topic!"
  },
  "source": "meta"
}