Skip to content

[TMVA][Python] Fix feature name handling for RBDT::LoadText#20565

Merged
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:issue-20267
Nov 28, 2025
Merged

[TMVA][Python] Fix feature name handling for RBDT::LoadText#20565
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:issue-20267

Conversation

@guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Nov 28, 2025

If the XGBoost model encodes feature names, they will also be used in the .txt dump of the model. We have to use these names in RBDT::LoadTxt as well, so that the .txt file can be read correctly without errors.

The RBDT unit test is also updated to cover this case of custom feature names, which happens when the training data comes from a pandas DataFrame.

Closes #20267. Credit goes to @jlidrych for the solution.

If the XGBoost model encodes feature names, they will also be used in
the `.txt` dump of the model. We have to use these names in
`RBDT::LoadTxt` as well, so that the `.txt` file can be read correctly
without errors.

The RBDT unit test is also updated to cover this case of custom feature
names, which happens when the training data comes from a pandas
DataFrame.

Also implement some suggestions by ruff.

Closes root-project#20267.
Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes LGTM, thanks! Please merge only once the tests are green

@guitargeek guitargeek merged commit 8c83c8f into root-project:master Nov 28, 2025
26 of 29 checks passed
@guitargeek guitargeek deleted the issue-20267 branch December 23, 2025 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TMVA.Experimental.SaveXGBoost and feature names

2 participants