{
  "id": 79289,
  "title": "Why 'max_bin' hyperparameter in lightgbm doesn't change anything?",
  "url": "/competitions/elo-merchant-category-recommendation/discussion/79289",
  "author_name": "",
  "post_date": "2019-02-02T08:34:40.540078400Z",
  "votes": null,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Recently, I am working on regularisation of our lightgbm model. There are couple of parameters which are suggested for tunning to avoid overfitting (<a href=\"https://lightgbm.readthedocs.io/en/latest/Parameters-Tuning.html\">https://lightgbm.readthedocs.io/en/latest/Parameters-Tuning.html</a>). When I change 'max_bin' from default to values 100,50 and 2 (for 1 gives error). I didn't observe any changes. It is quite strange since to my understanding lightgbm is histogram based algorithm. I will appreciate if someone can explain this observation.</p>",
  "messages": [
    {
      "id": "465061",
      "postDate": "02/02/2019 08:34:40",
      "content": "<p>Recently, I am working on regularisation of our lightgbm model. There are couple of parameters which are suggested for tunning to avoid overfitting (<a href=\"https://lightgbm.readthedocs.io/en/latest/Parameters-Tuning.html\">https://lightgbm.readthedocs.io/en/latest/Parameters-Tuning.html</a>). When I change 'max_bin' from default to values 100,50 and 2 (for 1 gives error). I didn't observe any changes. It is quite strange since to my understanding lightgbm is histogram based algorithm. I will appreciate if someone can explain this observation.</p>",
      "rawMarkdown": "Recently, I am working on regularisation of our lightgbm model. There are couple of parameters which are suggested for tunning to avoid overfitting (https://lightgbm.readthedocs.io/en/latest/Parameters-Tuning.html). When I change 'max_bin' from default to values 100,50 and 2 (for 1 gives error). I didn't observe any changes. It is quite strange since to my understanding lightgbm is histogram based algorithm. I will appreciate if someone can explain this observation.",
      "votes": null
    },
    {
      "id": "465385",
      "postDate": "02/03/2019 01:24:27",
      "content": "<p>via params dict?</p>",
      "rawMarkdown": "via params dict?",
      "votes": null
    },
    {
      "id": "465390",
      "postDate": "02/03/2019 01:44:44",
      "content": "<p>@ Alexsandr Kosolapov\nYes.</p>",
      "rawMarkdown": "Alexsandr Kosolapov\nYes.",
      "votes": null
    },
    {
      "id": "465642",
      "postDate": "02/03/2019 17:00:36",
      "content": "<p>Are you creating lightgbm datasets before changing params or loading previously saved dataset? \nIf saved then <code>max_bin</code> has been already applied to dataset and passing new <code>max_bin</code> value to params while training does not change anything.</p>",
      "rawMarkdown": "Are you creating lightgbm datasets before changing params or loading previously saved dataset? \nIf saved then `max_bin` has been already applied to dataset and passing new `max_bin` value to params while training does not change anything.",
      "votes": null
    },
    {
      "id": "465831",
      "postDate": "02/04/2019 05:10:13",
      "content": "<p>I generate dataset (lgb.Dataset(data,label=target)). Then, I train using lgb.train(param, trn_data). I pass parameters only for training.  Can we change 'max_bin' in when creating lightgbm dataset?</p>",
      "rawMarkdown": "I generate dataset (lgb.Dataset(data,label=target)). Then, I train using lgb.train(param, trn_data). I pass parameters only for training.  Can we change 'max_bin' in when creating lightgbm dataset?",
      "votes": null
    },
    {
      "id": "465870",
      "postDate": "02/04/2019 08:02:42",
      "content": "<p>Salamat, my understanding is that you may pass <code>max_bin</code> within params while creating lightgbm dataset, but you should call construct() on dataset to apply parameters. Usually construct() is called by train() method so <code>max_bin</code> from train is applied and you should not do anything extra.</p>\n\n<p>When you wrote that you generated dataset, the data you pass is numpy or pandas, not lgbm dataset, right?</p>\n\n<p>Running train outputs something like below:</p>\n\n<p><code>[LightGBM] [Info] Total Bins 561</code></p>\n\n<p>Do you see difference in Total Bins when run training with different <code>max_bin</code>?</p>",
      "rawMarkdown": "Salamat, my understanding is that you may pass `max_bin` within params while creating lightgbm dataset, but you should call construct() on dataset to apply parameters. Usually construct() is called by train() method so `max_bin` from train is applied and you should not do anything extra.\n\nWhen you wrote that you generated dataset, the data you pass is numpy or pandas, not lgbm dataset, right?\n\n\nRunning train outputs something like below:\n\n`[LightGBM] [Info] Total Bins 561`\n\nDo you see difference in Total Bins when run training with different `max_bin`?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 465385,
      "author_name": "jingobox",
      "author_url": "",
      "post_date": "02/03/2019 01:24:27",
      "content": "<p>via params dict?</p>",
      "votes": null,
      "replies": [
        {
          "id": 465390,
          "author_name": "salamatburj",
          "author_url": "",
          "post_date": "02/03/2019 01:44:44",
          "content": "<p>@ Alexsandr Kosolapov\nYes.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 465642,
      "author_name": "alexfir",
      "author_url": "",
      "post_date": "02/03/2019 17:00:36",
      "content": "<p>Are you creating lightgbm datasets before changing params or loading previously saved dataset? \nIf saved then <code>max_bin</code> has been already applied to dataset and passing new <code>max_bin</code> value to params while training does not change anything.</p>",
      "votes": null,
      "replies": [
        {
          "id": 465831,
          "author_name": "salamatburj",
          "author_url": "",
          "post_date": "02/04/2019 05:10:13",
          "content": "<p>I generate dataset (lgb.Dataset(data,label=target)). Then, I train using lgb.train(param, trn_data). I pass parameters only for training.  Can we change 'max_bin' in when creating lightgbm dataset?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 465870,
          "author_name": "alexfir",
          "author_url": "",
          "post_date": "02/04/2019 08:02:42",
          "content": "<p>Salamat, my understanding is that you may pass <code>max_bin</code> within params while creating lightgbm dataset, but you should call construct() on dataset to apply parameters. Usually construct() is called by train() method so <code>max_bin</code> from train is applied and you should not do anything extra.</p>\n\n<p>When you wrote that you generated dataset, the data you pass is numpy or pandas, not lgbm dataset, right?</p>\n\n<p>Running train outputs something like below:</p>\n\n<p><code>[LightGBM] [Info] Total Bins 561</code></p>\n\n<p>Do you see difference in Total Bins when run training with different <code>max_bin</code>?</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "465061": "Recently, I am working on regularisation of our lightgbm model. There are couple of parameters which are suggested for tunning to avoid overfitting (https://lightgbm.readthedocs.io/en/latest/Parameters-Tuning.html). When I change 'max_bin' from default to values 100,50 and 2 (for 1 gives error). I didn't observe any changes. It is quite strange since to my understanding lightgbm is histogram based algorithm. I will appreciate if someone can explain this observation.",
    "465385": "via params dict?",
    "465390": "Alexsandr Kosolapov\nYes.",
    "465642": "Are you creating lightgbm datasets before changing params or loading previously saved dataset? \nIf saved then `max_bin` has been already applied to dataset and passing new `max_bin` value to params while training does not change anything.",
    "465831": "I generate dataset (lgb.Dataset(data,label=target)). Then, I train using lgb.train(param, trn_data). I pass parameters only for training.  Can we change 'max_bin' in when creating lightgbm dataset?",
    "465870": "Salamat, my understanding is that you may pass `max_bin` within params while creating lightgbm dataset, but you should call construct() on dataset to apply parameters. Usually construct() is called by train() method so `max_bin` from train is applied and you should not do anything extra.\n\nWhen you wrote that you generated dataset, the data you pass is numpy or pandas, not lgbm dataset, right?\n\n\nRunning train outputs something like below:\n\n`[LightGBM] [Info] Total Bins 561`\n\nDo you see difference in Total Bins when run training with different `max_bin`?"
  },
  "source": "meta"
}