You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am a student studying machine learning in Korea. I am currently using the XGBoost library in a Python environment.
I used the following code to inspect the trained model:
booster = xgb_model.get_booster()
dump_list = booster.get_dump(dump_format='json')
print("\n=== Official XGBoost Tree Dump ===")
for i, tree in enumerate(dump_list):
print(f"Tree {i}:\n{tree}")
This provides details such as:
nodeid
depth
split (which feature was used)
split_condition (the threshold value)
yes, no, missing, children
leaf (leaf node weight)
However, I would like to access additional debugging information, specifically:
Histogram bins used for each feature during training
Candidate split points considered at each node
Gain values for each candidate split
I understand that this information is not available through booster.get_dump(), and I suspect that modifying the C++ source code might be necessary. However, I am unsure about the exact location in the code where this information is processed and how to print it effectively.
What I have tried
Setting verbosity=3, but this does not expose histogram details.
Looking into src/tree/updater_hist.cc, where functions like BuildHist and EvaluateSplits seem to handle histogram construction and split evaluation.
Considering adding LOG(INFO) or std::cout statements in the source code to debug this information.
Questions
Is there an existing way to enable detailed logging for histogram bins, split candidates, and gain values?
If modifying the C++ source is necessary, where would be the best place to insert logging statements to obtain this information?
Any guidance would be greatly appreciated! Thank you. 🙏
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I am a student studying machine learning in Korea. I am currently using the XGBoost library in a Python environment.
I used the following code to inspect the trained model:
This provides details such as:
However, I would like to access additional debugging information, specifically:
I understand that this information is not available through
booster.get_dump()
, and I suspect that modifying the C++ source code might be necessary. However, I am unsure about the exact location in the code where this information is processed and how to print it effectively.What I have tried
Questions
Any guidance would be greatly appreciated! Thank you. 🙏
Beta Was this translation helpful? Give feedback.
All reactions