Skip to content

Update Xgboost Benchmarks - #220

Open
avolkov-intel wants to merge 4 commits into
IntelPython:mainfrom
avolkov-intel:dev/upd-xgb-benchmarks
Open

Update Xgboost Benchmarks#220
avolkov-intel wants to merge 4 commits into
IntelPython:mainfrom
avolkov-intel:dev/upd-xgb-benchmarks

Conversation

@avolkov-intel

@avolkov-intel avolkov-intel commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Description

In this PR the new configs for xgboost benchmarks are introduced. Motivation is to make the use cases closer to real-world usage scenarios and cover some features from the recent xgboost versions.

  • Drop some use cases (datasets based on image data, hepmass from regression tasks)
  • Add new datasets from this paper: https://arxiv.org/abs/2506.16791
  • Add cases with categorical features and missing values to xgboost configs
  • Add task_dispatch decorator to enable usage same data with different targets
Checklist:

Completeness and readability

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes or created a separate PR with updates and provided its number in the description, if necessary.
  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have resolved any merge conflicts that might occur with the base branch.

Testing

  • I have run it locally and tested the changes extensively.
  • All CI jobs are green or I have provided justification why they aren't.
  • I have extended testing suite if new functionality was introduced in this PR.

"tree_method": "hist",
"n_jobs": "[SPECIAL_VALUE]physical_cpus"
"n_jobs": "[SPECIAL_VALUE]physical_cpus",
"enable_categorical": true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is enabled by default in the latest versions. Which xgboost version are you using where it makes an effect?

@avolkov-intel avolkov-intel Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We need to specify it to ensure comparison with previous xgboost version is correct

Comment on lines +62 to +67
# Read with the same engine used for writing (fastparquet). Reading a
# fastparquet-written file with the default "auto"/pyarrow engine drops
# pandas "category" dtype (string categories come back as object),
# which would prevent XGBoost's native categorical handling from ever
# seeing category columns loaded from cache.
data = pd.read_parquet(filepath, engine="fastparquet")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wouldn't a better fix be to switch both to pyarrow, or to use polars to read it?

@avolkov-intel avolkov-intel Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If the changes from the current PR are applied benchmark caches are not invalidated, we only change the code that is responsible for reading. If we switch to another engine then existing caches would be invalidated that might silently affect some CI jobs etc. Probably it worth doing later, I just don't want to deal with these changes in the current PR

Comment on lines +495 to +497
Source: OpenML dataset id 46939 (kddcup09_appetency, small training set).

Classification task. n_classes = 2.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These comments are redundant given the rest of the code below.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I would say that they are unnecessary, this brief description is really useful when you look at the configs and benchmarking results

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But you have the exact same info in a more succinct form right below it.

Comment on lines +32 to +42
# Remember which columns are categorical (and their exact CategoricalDtype)
# before the numpy round-trip below flattens the DataFrame and drops this
# metadata. The categoricals are restored after converting back to pandas,
# so estimators with native categorical support (e.g. XGBoost with
# enable_categorical=True) still see "category" columns.
categorical_dtypes = None
if (
dformat == "pandas"
and isinstance(data, pd.DataFrame)
and any(str(t) == "category" for t in data.dtypes)
):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread sklbench/datasets/transformer.py Outdated
@avolkov-intel
avolkov-intel marked this pull request as ready for review September 1, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants