{
  "id": 114318,
  "title": "LGBM vs XGB",
  "url": "/competitions/ashrae-energy-prediction/discussion/114318",
  "author_name": "",
  "post_date": "2019-10-25T13:08:38.094442300Z",
  "votes": 6,
  "comment_count": 7,
  "views": 0,
  "content": "<p>There is any reason why all the kernels are using lgbm instead of other boosting algorithms such as XGB, catb etc?</p>",
  "messages": [
    {
      "id": "657830",
      "postDate": "10/25/2019 13:08:38",
      "content": "<p>There is any reason why all the kernels are using lgbm instead of other boosting algorithms such as XGB, catb etc?</p>",
      "rawMarkdown": "There is any reason why all the kernels are using lgbm instead of other boosting algorithms such as XGB, catb etc?",
      "votes": null
    },
    {
      "id": "657838",
      "postDate": "10/25/2019 13:19:37",
      "content": "<p>The general assumption around using LightGBM vs XGBoost and CatBoost is <code>LGBM usually converges faster as compared to others and it uses all the cores available by default</code>. I have noticed and I guess others may have as well XGBoost and CatBoost are kind of have started to be not so popular these days. For details you can read this topic from a previous competition <a href=\"https://www.kaggle.com/c/LANL-Earthquake-Prediction/discussion/89909#519241\">https://www.kaggle.com/c/LANL-Earthquake-Prediction/discussion/89909#519241</a></p>",
      "rawMarkdown": "The general assumption around using LightGBM vs XGBoost and CatBoost is `LGBM usually converges faster as compared to others and it uses all the cores available by default`. I have noticed and I guess others may have as well XGBoost and CatBoost are kind of have started to be not so popular these days. For details you can read this topic from a previous competition https://www.kaggle.com/c/LANL-Earthquake-Prediction/discussion/89909#519241",
      "votes": null
    },
    {
      "id": "657841",
      "postDate": "10/25/2019 13:21:51",
      "content": "<p>I tried to use K-Folds with XGBoost, but on the second fold, my kernel fell due to lack of resources.\nLGBM are faster than XGBoost in training, and I think LGBM requires less memory and resources.\nHere is my XGBoost kernel, but I use only one fold:\n<a href=\"https://www.kaggle.com/ihelon/simple-xgboost\">https://www.kaggle.com/ihelon/simple-xgboost</a></p>",
      "rawMarkdown": "I tried to use K-Folds with XGBoost, but on the second fold, my kernel fell due to lack of resources.\nLGBM are faster than XGBoost in training, and I think LGBM requires less memory and resources.\nHere is my XGBoost kernel, but I use only one fold:\nhttps://www.kaggle.com/ihelon/simple-xgboost",
      "votes": null
    },
    {
      "id": "657887",
      "postDate": "10/25/2019 13:51:25",
      "content": "<p>I like GPU options for Catboost and XGB - it's way much faster than any CPU LGBM.</p>\n\n<p>But I like LGBM more. For me it's more \"white-boxed\" model. Easier to do FE analysis. Less \"params\" dependent. </p>\n\n<p>For Catboost you have to do much more runs to confirm that \"score boost\" was because of feature and not of model tuning. Even tuning not very stable, adding features changes model behavior greatly and new tuning step required.</p>\n\n<p>So for prototyping my choice is LGBM. </p>\n\n<p>But also I know many XGB adepts and Catboost adepts. </p>",
      "rawMarkdown": "I like GPU options for Catboost and XGB - it's way much faster than any CPU LGBM.\n\nBut I like LGBM more. For me it's more \"white-boxed\" model. Easier to do FE analysis. Less \"params\" dependent. \n\nFor Catboost you have to do much more runs to confirm that \"score boost\" was because of feature and not of model tuning. Even tuning not very stable, adding features changes model behavior greatly and new tuning step required.\n\nSo for prototyping my choice is LGBM. \n\nBut also I know many XGB adepts and Catboost adepts.",
      "votes": null
    },
    {
      "id": "657921",
      "postDate": "10/25/2019 14:12:33",
      "content": "<p>The two aspects that jump out to me as reasons why I prioritize lightgbm over the other two options --</p>\n\n<ol>\n<li><p><strong>Speed</strong>: lightgbm uses a histogram algorithm for splitting that's significantly faster and more memory efficient than default versions of the alternatives (xgboost does support a histogram mode though). Features are broken up into bins which are then used for making tree decision splits, meaning the data can be represented more efficiently and many fewer possible decision points need to be evaluated. This is even a form of regularization because it forces the model to be less granular in its splitting decisions.</p></li>\n<li><p><strong>Category handling</strong>: lightgbm has native support for <a href=\"https://lightgbm.readthedocs.io/en/latest/Advanced-Topics.html\">categorical features </a> that includes an optimal partitioning algorithm. In my experience this usually works well and prevents the pain of one hot encoding high cardinality categorical features, or figuring out a good numerical representation for those features. </p></li>\n</ol>\n\n<p>I've admittedly not really used catboost, but my understanding is that it can be significantly slower than lightgbm, and I'm not convinced that its target encoding of categories is a better strategy than partitioning (I tend to be skeptical of target encoding in general). </p>",
      "rawMarkdown": "The two aspects that jump out to me as reasons why I prioritize lightgbm over the other two options --\n\n1. **Speed**: lightgbm uses a histogram algorithm for splitting that's significantly faster and more memory efficient than default versions of the alternatives (xgboost does support a histogram mode though). Features are broken up into bins which are then used for making tree decision splits, meaning the data can be represented more efficiently and many fewer possible decision points need to be evaluated. This is even a form of regularization because it forces the model to be less granular in its splitting decisions.\n\n2. **Category handling**: lightgbm has native support for [categorical features ](https://lightgbm.readthedocs.io/en/latest/Advanced-Topics.html) that includes an optimal partitioning algorithm. In my experience this usually works well and prevents the pain of one hot encoding high cardinality categorical features, or figuring out a good numerical representation for those features. \n\nI've admittedly not really used catboost, but my understanding is that it can be significantly slower than lightgbm, and I'm not convinced that its target encoding of categories is a better strategy than partitioning (I tend to be skeptical of target encoding in general).",
      "votes": null
    },
    {
      "id": "657996",
      "postDate": "10/25/2019 15:14:56",
      "content": "<p>Great explanation <a href=\"/aquatic\">@aquatic</a>  . </p>\n\n<blockquote>\n  <p>significantly faster and more memory efficient</p>\n</blockquote>\n\n<p>Any thoughts about python api vs scikit-learn api for lgbm for speed and memory?</p>",
      "rawMarkdown": "Great explanation @aquatic  . \n\n&gt; significantly faster and more memory efficient\n\nAny thoughts about python api vs scikit-learn api for lgbm for speed and memory?",
      "votes": null
    },
    {
      "id": "658000",
      "postDate": "10/25/2019 15:20:38",
      "content": "<p>Konstantin have summed it well. I Agree with him.</p>\n\n<p>The way I would proceed for classification task is plot feature importance plot from lgbm model as the first thing even before EDA. I feel it is very crucial to know important features asap.</p>",
      "rawMarkdown": "Konstantin have summed it well. I Agree with him.\n\nThe way I would proceed for classification task is plot feature importance plot from lgbm model as the first thing even before EDA. I feel it is very crucial to know important features asap.",
      "votes": null
    },
    {
      "id": "659027",
      "postDate": "10/27/2019 00:39:57",
      "content": "<p>Have used lightgbm over XGB as it's always seemed a bit faster and a bit easier to tune parameters.</p>\n\n<p>Have fallen in love with Catboost however in this competition.  It uses my two GPU to 96% of capacity with only a single line of code needed.  Running both Windows and Ubuntu machines and I never could manage to get lightgbm GPU version installed on Win 10.</p>",
      "rawMarkdown": "Have used lightgbm over XGB as it's always seemed a bit faster and a bit easier to tune parameters.\n\nHave fallen in love with Catboost however in this competition.  It uses my two GPU to 96% of capacity with only a single line of code needed.  Running both Windows and Ubuntu machines and I never could manage to get lightgbm GPU version installed on Win 10.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 657838,
      "author_name": "cyberia",
      "author_url": "",
      "post_date": "10/25/2019 13:19:37",
      "content": "<p>The general assumption around using LightGBM vs XGBoost and CatBoost is <code>LGBM usually converges faster as compared to others and it uses all the cores available by default</code>. I have noticed and I guess others may have as well XGBoost and CatBoost are kind of have started to be not so popular these days. For details you can read this topic from a previous competition <a href=\"https://www.kaggle.com/c/LANL-Earthquake-Prediction/discussion/89909#519241\">https://www.kaggle.com/c/LANL-Earthquake-Prediction/discussion/89909#519241</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 657887,
          "author_name": "kyakovlev",
          "author_url": "",
          "post_date": "10/25/2019 13:51:25",
          "content": "<p>I like GPU options for Catboost and XGB - it's way much faster than any CPU LGBM.</p>\n\n<p>But I like LGBM more. For me it's more \"white-boxed\" model. Easier to do FE analysis. Less \"params\" dependent. </p>\n\n<p>For Catboost you have to do much more runs to confirm that \"score boost\" was because of feature and not of model tuning. Even tuning not very stable, adding features changes model behavior greatly and new tuning step required.</p>\n\n<p>So for prototyping my choice is LGBM. </p>\n\n<p>But also I know many XGB adepts and Catboost adepts. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 658000,
          "author_name": "cyberia",
          "author_url": "",
          "post_date": "10/25/2019 15:20:38",
          "content": "<p>Konstantin have summed it well. I Agree with him.</p>\n\n<p>The way I would proceed for classification task is plot feature importance plot from lgbm model as the first thing even before EDA. I feel it is very crucial to know important features asap.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 657841,
      "author_name": "ihelon",
      "author_url": "",
      "post_date": "10/25/2019 13:21:51",
      "content": "<p>I tried to use K-Folds with XGBoost, but on the second fold, my kernel fell due to lack of resources.\nLGBM are faster than XGBoost in training, and I think LGBM requires less memory and resources.\nHere is my XGBoost kernel, but I use only one fold:\n<a href=\"https://www.kaggle.com/ihelon/simple-xgboost\">https://www.kaggle.com/ihelon/simple-xgboost</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 657921,
      "author_name": "aquatic",
      "author_url": "",
      "post_date": "10/25/2019 14:12:33",
      "content": "<p>The two aspects that jump out to me as reasons why I prioritize lightgbm over the other two options --</p>\n\n<ol>\n<li><p><strong>Speed</strong>: lightgbm uses a histogram algorithm for splitting that's significantly faster and more memory efficient than default versions of the alternatives (xgboost does support a histogram mode though). Features are broken up into bins which are then used for making tree decision splits, meaning the data can be represented more efficiently and many fewer possible decision points need to be evaluated. This is even a form of regularization because it forces the model to be less granular in its splitting decisions.</p></li>\n<li><p><strong>Category handling</strong>: lightgbm has native support for <a href=\"https://lightgbm.readthedocs.io/en/latest/Advanced-Topics.html\">categorical features </a> that includes an optimal partitioning algorithm. In my experience this usually works well and prevents the pain of one hot encoding high cardinality categorical features, or figuring out a good numerical representation for those features. </p></li>\n</ol>\n\n<p>I've admittedly not really used catboost, but my understanding is that it can be significantly slower than lightgbm, and I'm not convinced that its target encoding of categories is a better strategy than partitioning (I tend to be skeptical of target encoding in general). </p>",
      "votes": null,
      "replies": [
        {
          "id": 657996,
          "author_name": "cyberia",
          "author_url": "",
          "post_date": "10/25/2019 15:14:56",
          "content": "<p>Great explanation <a href=\"/aquatic\">@aquatic</a>  . </p>\n\n<blockquote>\n  <p>significantly faster and more memory efficient</p>\n</blockquote>\n\n<p>Any thoughts about python api vs scikit-learn api for lgbm for speed and memory?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 659027,
      "author_name": "pcjimmmy",
      "author_url": "",
      "post_date": "10/27/2019 00:39:57",
      "content": "<p>Have used lightgbm over XGB as it's always seemed a bit faster and a bit easier to tune parameters.</p>\n\n<p>Have fallen in love with Catboost however in this competition.  It uses my two GPU to 96% of capacity with only a single line of code needed.  Running both Windows and Ubuntu machines and I never could manage to get lightgbm GPU version installed on Win 10.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "657830": "There is any reason why all the kernels are using lgbm instead of other boosting algorithms such as XGB, catb etc?",
    "657838": "The general assumption around using LightGBM vs XGBoost and CatBoost is `LGBM usually converges faster as compared to others and it uses all the cores available by default`. I have noticed and I guess others may have as well XGBoost and CatBoost are kind of have started to be not so popular these days. For details you can read this topic from a previous competition https://www.kaggle.com/c/LANL-Earthquake-Prediction/discussion/89909#519241",
    "657841": "I tried to use K-Folds with XGBoost, but on the second fold, my kernel fell due to lack of resources.\nLGBM are faster than XGBoost in training, and I think LGBM requires less memory and resources.\nHere is my XGBoost kernel, but I use only one fold:\nhttps://www.kaggle.com/ihelon/simple-xgboost",
    "657887": "I like GPU options for Catboost and XGB - it's way much faster than any CPU LGBM.\n\nBut I like LGBM more. For me it's more \"white-boxed\" model. Easier to do FE analysis. Less \"params\" dependent. \n\nFor Catboost you have to do much more runs to confirm that \"score boost\" was because of feature and not of model tuning. Even tuning not very stable, adding features changes model behavior greatly and new tuning step required.\n\nSo for prototyping my choice is LGBM. \n\nBut also I know many XGB adepts and Catboost adepts.",
    "657921": "The two aspects that jump out to me as reasons why I prioritize lightgbm over the other two options --\n\n1. **Speed**: lightgbm uses a histogram algorithm for splitting that's significantly faster and more memory efficient than default versions of the alternatives (xgboost does support a histogram mode though). Features are broken up into bins which are then used for making tree decision splits, meaning the data can be represented more efficiently and many fewer possible decision points need to be evaluated. This is even a form of regularization because it forces the model to be less granular in its splitting decisions.\n\n2. **Category handling**: lightgbm has native support for [categorical features ](https://lightgbm.readthedocs.io/en/latest/Advanced-Topics.html) that includes an optimal partitioning algorithm. In my experience this usually works well and prevents the pain of one hot encoding high cardinality categorical features, or figuring out a good numerical representation for those features. \n\nI've admittedly not really used catboost, but my understanding is that it can be significantly slower than lightgbm, and I'm not convinced that its target encoding of categories is a better strategy than partitioning (I tend to be skeptical of target encoding in general).",
    "657996": "Great explanation @aquatic  . \n\n&gt; significantly faster and more memory efficient\n\nAny thoughts about python api vs scikit-learn api for lgbm for speed and memory?",
    "658000": "Konstantin have summed it well. I Agree with him.\n\nThe way I would proceed for classification task is plot feature importance plot from lgbm model as the first thing even before EDA. I feel it is very crucial to know important features asap.",
    "659027": "Have used lightgbm over XGB as it's always seemed a bit faster and a bit easier to tune parameters.\n\nHave fallen in love with Catboost however in this competition.  It uses my two GPU to 96% of capacity with only a single line of code needed.  Running both Windows and Ubuntu machines and I never could manage to get lightgbm GPU version installed on Win 10."
  },
  "source": "meta"
}