Setting the number of bins?

(New here, nice to meet you.)

I am trying to set the number of bins in XGBClassifier by using max_bin, but something looks completely off…
My tree_method is set to hist. I try changing max_bin to various values, including extremely small and large ones, but the results are always almost unchanged (they seem to change to a tiny degree).

I have three questions on this:
Am I missing something?
Is the “max” in max_bin just a suggestion, and if yes then how do we set the exact number of bins?
How can I find out the number of bins actually used by the model?

Update: I wonder whether I misunderstood something…

The documentation says “max_bin: if using histogram-based algorithm, maximum number of bins per feature”. So, is it relevant only to the properties of the histograms?

My original question is actually about binning the range of the input values when looking for the optimal split… I’d expect that this is something that can be set by the user.

  • I assume you checked that the number of values features take is much greater than the number of bins.
  • Another possibility is that you are using a relatively small dataset for which histograms are not expected to give significant advantage, and xgboost automatically falls back to the exact algorithm (because it always better). This is just a guess, I am not an expert and I don’t know how it actually works.