dmlc / dmlc/xgboost

XGBoost get_dump missing information for multiclass classifiers

Open
#6,623 10 comments 0 reactions 0 assignees View on GitHub
feature-request
Dominant language
C++
Stars
28.8k
Forks
8.9k
Avg merge
1d 12h
Merged PRs (30d)
54

Description

Hey there!
As taken from the comment [here](https://github.com/dmlc/xgboost/issues/6574):
```
To determine prediction for a multi-class classifier, we divide the trees into C groups (C = number of classes) and compute the partial sum of outputs for each group.
```
Note that each class has its own trees, but there is currently no way to associate a tree with its group.
The information has to be available somewhere, otherwise prediction wouldn't work at all, but it's not exported when dumping the model.
I took a look and it seems that the information is kept under `GBTreeModel` in the `tree_info` member.
When calling `SaveModel` it is saved, but when calling `DumpModel` the only output is the trees and not which group they're associated with.

I'd love to hear your input on this.
Thanks and I really appreciate your work!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the SaveModel and DumpModel paths, focusing on GBTreeModel and its tree_info member. Trace how tree_info associates trees with multiclass groups and determine how that association should appear in dumped output. Done means DumpModel exposes each tree's group without removing existing tree information, with coverage for multiclass models.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.