Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions configs/common/xgboost.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"device": "cpu",
"estimator_params": {
"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

},
"enable_modelbuilders": false
}
Expand All @@ -16,7 +17,8 @@
"device": "gpu",
"estimator_params": {
"tree_method": "hist",
"n_jobs": "[SPECIAL_VALUE]physical_cpus"
"n_jobs": "[SPECIAL_VALUE]physical_cpus",
"enable_categorical": true
}
},
"data": { "format": "cudf" }
Expand Down
97 changes: 81 additions & 16 deletions configs/regular/xgboost_binary.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"data": {
"dataset": "airline_depdelay",
"preprocessing_kwargs": {
"category_encoding": ["onehot", "ordinal"],
"subsample": 600000
"category_encoding": ["ordinal"],
"subsample": 700000
},
"split_kwargs": {
"train_size": 100000,
"train_size": 200000,
"test_size": 500000
}
},
Expand All @@ -26,37 +26,102 @@
},
{
"data": {
"dataset": "hepmass",
"dataset": "airline_satisfaction",
"preprocessing_kwargs": {
"category_encoding": ["ignore", "ordinal"]
},
"split_kwargs": {
"train_size": 200000,
"test_size": 1000000
"test_size": 0.2,
"random_state": 42
}
},
"algorithm": {
"estimator_params": {
"learning_rate": 0.1,
"reg_alpha": 1.0,
"max_depth": 6,
"reg_lambda": 1.0,
"max_leaves": 256,
"n_estimators": 500
"n_estimators": 1000,
"enable_categorical": true
}
}
},
{
"data": {
"dataset": "amazon_employee_access",
"preprocessing_kwargs": {
"category_encoding": ["ignore", "ordinal"]
},
"split_kwargs": {
"test_size": 0.2,
"random_state": 42
}
},
"algorithm": {
"estimator_params": {
"learning_rate": 0.05,
"max_depth": 6,
"reg_lambda": 1.0,
"n_estimators": 500,
"enable_categorical": true
}
}
},
{
"data": {
"dataset": "gisette",
"dataset": "apsfailure",
"preprocessing_kwargs": {
"replace_nan": ["ignore", "mean"]
},
"split_kwargs": {
"train_size": 2000,
"test_size": 5000
"test_size": 0.2,
"random_state": 42
}
},
"algorithm": {
"estimator_params": {
"learning_rate": 0.15,
"learning_rate": 0.05,
"max_depth": 6,
"subsample": 0.8,
"colsample_bytree": 0.8,
"reg_lambda": 1.0,
"n_estimators": 200
}
}
},
{
"data": {
"dataset": "bioresponse",
"split_kwargs": {
"test_size": 0.2,
"random_state": 42
}
},
"algorithm": {
"estimator_params": {
"learning_rate": 0.05,
"max_depth": 6,
"subsample": 0.8,
"colsample_bytree": 0.8,
"reg_lambda": 1.0,
"n_estimators": 200
}
}
},
{
"data": {
"dataset": "hepmass",
"split_kwargs": {
"train_size": 400000,
"test_size": 1000000
}
},
"algorithm": {
"estimator_params": {
"learning_rate": 0.1,
"reg_alpha": 1.0,
"reg_lambda": 1.0,
"max_leaves": 256,
"colsample_bytree": 0.1,
"colsample_bynode": 0.1,
"n_estimators": 100
"n_estimators": 200
}
}
}
Expand Down
44 changes: 5 additions & 39 deletions configs/regular/xgboost_multi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,11 @@
"gbt multi classification data": [
{
"data": {
"dataset": "letters",
"split_kwargs": {
"train_size": 0.5,
"test_size": 0.5
}
},
"algorithm": {
"estimator_params": {
"learning_rate": 0.05,
"reg_lambda": 1,
"max_depth": 6,
"n_estimators": 200
}
}
},
{
"data": {
"dataset": "mnist",
"split_kwargs": {
"train_size": 20000,
"test_size": 50000
}
"dataset": "connect"
},
"algorithm": {
"estimator_params": {
"max_leaves": 256,
"colsample_bytree": 0.2,
"colsample_bynode": 0.5,
"n_estimators": 100
"n_estimators": 500
}
}
},
Expand All @@ -42,20 +18,10 @@
},
"algorithm": {
"estimator_params": {
"learning_rate": 0.1,
"learning_rate": 0.3,
"reg_lambda": 1,
"max_depth": 8,
"n_estimators": 200
}
}
},
{
"data": {
"dataset": "connect"
},
"algorithm": {
"estimator_params": {
"n_estimators": 500
"max_depth": 14,
"n_estimators": 100
}
}
}
Expand Down
86 changes: 58 additions & 28 deletions configs/regular/xgboost_regression.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,25 @@
"gbt regression data": [
{
"data": {
"dataset": "twodplanes",
"dataset": "airline_depdelay",
"dataset_kwargs": {
"task": "regression"
},
"preprocessing_kwargs": {
"category_encoding": "ordinal",
"subsample": 700000
},
"split_kwargs": {
"train_size": 0.33,
"test_size": null
"train_size": 200000,
"test_size": 500000
}
},
"algorithm": {
"estimator_params": {
"learning_rate": 0.01,
"learning_rate": 0.1,
"max_depth": 8,
"reg_alpha": 1.0,
"reg_lambda": 0.1,
"reg_lambda": 1.0,
"n_estimators": 500
}
}
Expand All @@ -23,8 +31,8 @@
"data": {
"dataset": "medical_charges_nominal",
"split_kwargs": {
"train_size": 0.1,
"test_size": 0.9
"train_size": 0.5,
"test_size": 0.5
}
},
"algorithm": {
Expand All @@ -39,54 +47,76 @@
},
{
"data": {
"dataset": "year_prediction_msd",
"dataset": "nyc_taxi_green",
"preprocessing_kwargs": {
"category_encoding": ["ordinal", "ignore"]
},
"split_kwargs": {
"train_size": 0.25,
"test_size": 0.75
"test_size": 0.2,
"random_state": 42
}
},
"algorithm": {
"estimator_params": {
"learning_rate": 0.1,
"reg_alpha": 0.5,
"reg_lambda": 0.5,
"n_estimators": 200
"max_depth": 8,
"reg_lambda": 1.0,
"n_estimators": 500
}
}
},
{
"data": {
"dataset": "hepmass",
"dataset": "qsar_tid_11",
"split_kwargs": {
"train_size": 200000,
"test_size": 1000000
"test_size": 0.2,
"random_state": 42
}
},
"algorithm": {
"estimator_params": {
"learning_rate": 0.1,
"reg_alpha": 1.0,
"learning_rate": 0.05,
"max_depth": 6,
"subsample": 0.8,
"colsample_bytree": 0.8,
"reg_lambda": 1.0,
"max_leaves": 256,
"n_estimators": 500
"n_estimators": 1000
}
}
},
{
"data": {
"dataset": "superconductivity",
"split_kwargs": {
"test_size": 0.2,
"random_state": 42
}
},
"algorithm": {
"estimator_params": {
"learning_rate": 0.02,
"max_depth": 7,
"subsample": 0.8,
"colsample_bytree": 0.8,
"reg_lambda": 1.0,
"n_estimators": 1500
}
}
},
{
"data": {
"dataset": "gisette",
"dataset": "year_prediction_msd",
"split_kwargs": {
"train_size": 2000,
"test_size": 5000
"train_size": 0.5,
"test_size": 0.5
}
},
"algorithm": {
"estimator_params": {
"learning_rate": 0.15,
"max_leaves": 256,
"colsample_bytree": 0.1,
"colsample_bynode": 0.1,
"n_estimators": 100
"learning_rate": 0.1,
"reg_alpha": 0.5,
"reg_lambda": 0.5,
"n_estimators": 200
}
}
}
Expand Down
18 changes: 18 additions & 0 deletions sklbench/benchmarks/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
# ===============================================================================

import argparse
import inspect
import json
from typing import Dict

from ..datasets.common import preprocess_x
from ..utils.bench_case import get_bench_case_value, get_data_name
from ..utils.custom_types import BenchCase
from ..utils.logger import logger
Expand Down Expand Up @@ -50,6 +52,22 @@ def enrich_result(result: Dict, bench_case: BenchCase) -> Dict:
f"`{result['library']}` to `sklearnex` in benchmark output."
)
result["library"] = "sklearnex"
preproc_kwargs = get_bench_case_value(bench_case, "data:preprocessing_kwargs", dict())
preproc_defaults = {
name: param.default
for name, param in inspect.signature(preprocess_x).parameters.items()
}
result.update(
{
"category_encoding": preproc_kwargs.get(
"category_encoding", preproc_defaults["category_encoding"]
),
"replace_nan": preproc_kwargs.get(
"replace_nan", preproc_defaults["replace_nan"]
),
"normalize": preproc_kwargs.get("normalize", preproc_defaults["normalize"]),
}
)
taskset = get_bench_case_value(bench_case, "bench:taskset", None)
if taskset is not None:
result.update({"taskset": taskset})
Expand Down
Loading
Loading