Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init estimation for regression. #8272

Merged
merged 152 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
ec2a702
Calculate `base_score` based on input labels.
trivialfis Jul 22, 2022
eb77b61
Merge branch 'master' into init-estimation-ls
trivialfis Sep 20, 2022
86f5a14
Move.
trivialfis Sep 20, 2022
0f0fbb6
move.
trivialfis Sep 20, 2022
b1597d2
Merge branch 'master' into init-estimation-ls
trivialfis Sep 21, 2022
ad9728a
impl weighted mean.
trivialfis Sep 22, 2022
a9db927
split up.
trivialfis Sep 22, 2022
d9b6aa0
cleanup.
trivialfis Sep 22, 2022
027d3b7
Merge branch 'master' into init-estimation-ls
trivialfis Sep 26, 2022
b2b9924
Move transform iterator.
trivialfis Sep 26, 2022
f098799
Define for l2 only.
trivialfis Sep 26, 2022
53d6943
cleanup.
trivialfis Sep 26, 2022
b71dcca
Doc.
trivialfis Sep 26, 2022
abf6aea
lint.
trivialfis Sep 26, 2022
7ac09ac
Fix CPU build.
trivialfis Sep 26, 2022
d524413
fix.
trivialfis Sep 26, 2022
dbc6b3c
Fix test.
trivialfis Sep 26, 2022
ca4b207
lint.
trivialfis Sep 26, 2022
6b4ad58
ama.
trivialfis Sep 26, 2022
99e0fd3
revert.
trivialfis Sep 26, 2022
9a109a8
amalgamation.
trivialfis Sep 26, 2022
e8c60a8
Fix tests.
trivialfis Sep 26, 2022
bacaee3
Fix demo.
trivialfis Sep 26, 2022
7bb82cd
[WIP] try to use decision stump.
trivialfis Sep 27, 2022
07e120e
cpu build.
trivialfis Sep 27, 2022
3439532
Fix new obj.
trivialfis Sep 27, 2022
67feffa
Cleanup.
trivialfis Sep 27, 2022
7f4b84b
Fix.
trivialfis Sep 27, 2022
5a60e1f
Lint.
trivialfis Sep 27, 2022
ee30d13
Skip multi target.
trivialfis Sep 27, 2022
0217902
Fix leaf weight.
trivialfis Sep 27, 2022
44dcc87
Merge branch 'master' into init-estimation-ls
trivialfis Sep 27, 2022
652f143
Cleanup weighted mean.
trivialfis Sep 28, 2022
1a4ec0d
fix test.
trivialfis Sep 28, 2022
f9d9111
fix test.
trivialfis Sep 28, 2022
ef39bf3
Fix test.
trivialfis Sep 28, 2022
40dc08e
Fix test.
trivialfis Sep 28, 2022
aa739fb
Save the parameter.
trivialfis Sep 28, 2022
7685b45
model schema.
trivialfis Sep 28, 2022
2798d0e
Merge branch 'master' into init-estimation-ls
trivialfis Oct 5, 2022
b2bb9bb
distributed.
trivialfis Oct 5, 2022
021a281
Handle empty datasets.
trivialfis Oct 6, 2022
7136496
Merge branch 'master' into init-estimation-ls
trivialfis Oct 6, 2022
82281e1
include.
trivialfis Oct 6, 2022
7f6dc31
Merge branch 'master' into init-estimation-ls
trivialfis Oct 8, 2022
bb9002b
doc.
trivialfis Oct 8, 2022
e414b35
tests.
trivialfis Oct 8, 2022
cd945e7
Bring back weighted mean.
trivialfis Oct 9, 2022
0d061af
Revert "Bring back weighted mean."
trivialfis Oct 9, 2022
925ceaa
hardcode.
trivialfis Oct 9, 2022
2053576
fix.
trivialfis Oct 9, 2022
e9659b2
Fix dask test.
trivialfis Oct 9, 2022
8178844
includes.
trivialfis Oct 9, 2022
9807862
Use dh reduce.
trivialfis Oct 12, 2022
7e07d28
Fix.
trivialfis Oct 12, 2022
ed757c2
Fix.
trivialfis Oct 12, 2022
7076052
Fixes.
trivialfis Oct 12, 2022
0702c58
Cleanup.
trivialfis Oct 12, 2022
52afcac
Merge branch 'master' into init-estimation-ls
trivialfis Oct 12, 2022
1b88ef6
cleanup.
trivialfis Oct 12, 2022
8b04457
Reduce.
trivialfis Oct 12, 2022
c18f035
Fix.
trivialfis Oct 12, 2022
4251f35
Cleanup.
trivialfis Oct 12, 2022
a08fce4
Fix.
trivialfis Oct 12, 2022
154c9c4
Fix spark test.
trivialfis Oct 12, 2022
44b8cd4
hard coded tests.
trivialfis Oct 12, 2022
1206344
Run tests on github action.
trivialfis Oct 13, 2022
14e7bbe
Hard coded.
trivialfis Oct 13, 2022
701acdf
Fix mgpu test.
trivialfis Oct 13, 2022
397bbc3
Get devices.
trivialfis Oct 13, 2022
27934b3
Fix path.
trivialfis Oct 13, 2022
edc1e92
Unnecessary duplication.
trivialfis Oct 13, 2022
46d3165
Fix eval test.
trivialfis Oct 13, 2022
543185e
Fix local test.
trivialfis Oct 13, 2022
a16e023
Fixes.
trivialfis Oct 13, 2022
e092769
Fix.
trivialfis Oct 13, 2022
5400f40
Merge branch 'master' into init-estimation-ls
trivialfis Oct 13, 2022
f383ee9
format.
trivialfis Oct 13, 2022
6f86ca6
Fix.
trivialfis Oct 13, 2022
38c07b5
Remove google test.
trivialfis Oct 13, 2022
cb48bda
black version.
trivialfis Oct 13, 2022
a192fd0
Enable type hint for users.
trivialfis Oct 13, 2022
8965500
env name.
trivialfis Oct 13, 2022
d7cd66f
black.
trivialfis Oct 13, 2022
4c5ab95
Fix.
trivialfis Oct 13, 2022
1446407
lint.
trivialfis Oct 13, 2022
9336ab9
fix threads.
trivialfis Oct 13, 2022
63b7c8a
Merge.
trivialfis Oct 14, 2022
27bd7ee
Revert "Merge."
trivialfis Oct 14, 2022
56ac100
boost from avg.
trivialfis Oct 14, 2022
a2c72d5
Fix build.
trivialfis Oct 14, 2022
cc9b4ff
Fix macos.
trivialfis Oct 14, 2022
4946021
Model is fitted.
trivialfis Oct 14, 2022
a93c80a
Merge branch 'master' into init-estimation-ls
trivialfis Oct 18, 2022
b3ac21b
Revert local changes.
trivialfis Dec 5, 2022
f5f675f
Merge branch 'master' into init-estimation-ls
trivialfis Dec 5, 2022
6c7b4ff
Merge branch 'master' into init-estimation-ls
trivialfis Dec 6, 2022
ba08063
isort.
trivialfis Dec 6, 2022
b52d72e
Revert conda changes.
trivialfis Dec 6, 2022
01c1c7d
Merge branch 'master' into init-estimation-ls
trivialfis Dec 14, 2022
9c943e9
Fix merge.
trivialfis Dec 14, 2022
733b2d8
Add cpp dependencies.
trivialfis Dec 14, 2022
cdb741a
Multi target.
trivialfis Dec 14, 2022
98d7f09
GPU.
trivialfis Dec 14, 2022
a2efb89
rename.
trivialfis Dec 14, 2022
c923d30
Cleanup.
trivialfis Dec 14, 2022
c182094
comment.
trivialfis Dec 14, 2022
ce59f2a
Remove.
trivialfis Dec 14, 2022
fcb8554
Cleanup.
trivialfis Dec 14, 2022
7028468
cpu build & cleanup.
trivialfis Dec 14, 2022
c08a2e1
remove.
trivialfis Dec 14, 2022
93b223e
revert.
trivialfis Dec 14, 2022
19d6f23
exclude multi
trivialfis Dec 14, 2022
eb4d9b8
Extend to other objectives.
trivialfis Dec 14, 2022
f9310a9
cpu build.
trivialfis Dec 14, 2022
b2c65d9
cpu test.
trivialfis Dec 14, 2022
1be9b5d
Fix.
trivialfis Dec 15, 2022
d89c609
R build.
trivialfis Dec 15, 2022
d0f4081
move back to reg.
trivialfis Dec 15, 2022
3cb7500
Revert changes.
trivialfis Dec 15, 2022
3409ea2
Timeout.
trivialfis Dec 15, 2022
6efabc2
cleanup.
trivialfis Dec 15, 2022
cac6ce1
cleanup.
trivialfis Dec 15, 2022
0286125
Add dask tests.
trivialfis Dec 15, 2022
d75028e
add dask clf test.
trivialfis Dec 15, 2022
007b494
rng.
trivialfis Dec 15, 2022
7db21c2
lint.
trivialfis Dec 15, 2022
c695509
subobject.
trivialfis Dec 15, 2022
469a39d
test.
trivialfis Dec 15, 2022
5ded8f5
isort.
trivialfis Dec 15, 2022
6db5b6c
Refactor PySpark tests.
trivialfis Dec 16, 2022
47778a7
lint.
trivialfis Dec 16, 2022
5015b2f
Merge branch 'master' into init-estimation-ls
trivialfis Dec 16, 2022
8cc70d3
Cleanup.
trivialfis Dec 16, 2022
6b1f8bf
Fix ci.
trivialfis Dec 17, 2022
78f44f5
Merge changes.
trivialfis Dec 17, 2022
66e010b
tidy.
trivialfis Dec 17, 2022
529ed42
Merge branch 'init-estimation-ls' of github.com:trivialfis/xgboost in…
trivialfis Dec 17, 2022
1134b1b
Row major.
trivialfis Dec 17, 2022
bf58786
Merge remote-tracking branch 'jiamingy/init-estimation-ls' into init-…
trivialfis Dec 17, 2022
7a8e2ed
deterministic.
trivialfis Dec 17, 2022
a9f2dc9
Merge branch 'master' into init-estimation-ls
trivialfis Jan 4, 2023
dcdef53
cleanup.
trivialfis Jan 5, 2023
504cc8c
cleanup.
trivialfis Jan 5, 2023
1d8ce21
Merge branch 'master' into init-estimation-ls
trivialfis Jan 5, 2023
7d8464c
Get base score.
trivialfis Jan 5, 2023
a940363
get base score.
trivialfis Jan 5, 2023
4990d10
debug CI.
trivialfis Jan 5, 2023
8f62d21
Merge remote-tracking branch 'jiamingy/init-estimation-ls' into init-…
trivialfis Jan 5, 2023
475c7f2
Upgrade shap.
trivialfis Jan 5, 2023
7a851a2
revert.
trivialfis Jan 5, 2023
9e62a46
Fix empty test.
trivialfis Jan 5, 2023
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
57 changes: 57 additions & 0 deletions .github/workflows/python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,60 @@ jobs:
shell: bash -l {0}
run: |
pytest -s -v -rxXs --durations=0 ./tests/python

python-tests-on-ubuntu:
name: Test XGBoost Python package on ${{ matrix.config.os }}
runs-on: ${{ matrix.config.os }}
timeout-minutes: 90
strategy:
matrix:
config:
- {os: ubuntu-latest, python-version: "3.8"}

steps:
- uses: actions/checkout@v2
with:
submodules: 'true'

- uses: mamba-org/provision-with-micromamba@f347426e5745fe3dfc13ec5baf20496990d0281f # v14
with:
cache-downloads: true
cache-env: true
environment-name: linux_cpu_test
environment-file: tests/ci_build/conda_env/linux_cpu_test.yml

- name: Display Conda env
shell: bash -l {0}
run: |
conda info
conda list

- name: Build XGBoost on Ubuntu
shell: bash -l {0}
run: |
mkdir build
cd build
cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
ninja

- name: Install Python package
shell: bash -l {0}
run: |
cd python-package
python --version
python setup.py install

- name: Test Python package
shell: bash -l {0}
run: |
pytest -s -v -rxXs --durations=0 ./tests/python

- name: Test Dask Interface
shell: bash -l {0}
run: |
pytest -s -v -rxXs --durations=0 ./tests/test_distributed/test_with_dask

- name: Test PySpark Interface
shell: bash -l {0}
run: |
pytest -s -v -rxXs --durations=0 ./tests/test_distributed/test_with_spark
2 changes: 1 addition & 1 deletion R-package/tests/testthat/test_callbacks.R
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ test_that("prediction in early-stopping xgb.cv works", {
expect_output(
cv <- xgb.cv(param, dtrain, nfold = 5, eta = 0.1, nrounds = 20,
early_stopping_rounds = 5, maximize = FALSE, stratified = FALSE,
prediction = TRUE)
prediction = TRUE, base_score = 0.5)
, "Stopping. Best iteration")

expect_false(is.null(cv$best_iteration))
Expand Down
9 changes: 6 additions & 3 deletions R-package/tests/testthat/test_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ if (isTRUE(VCD_AVAILABLE)) {
# binary
bst.Tree <- xgboost(data = sparse_matrix, label = label, max_depth = 9,
eta = 1, nthread = 2, nrounds = nrounds, verbose = 0,
objective = "binary:logistic", booster = "gbtree")
objective = "binary:logistic", booster = "gbtree",
base_score = 0.5)

bst.GLM <- xgboost(data = sparse_matrix, label = label,
eta = 1, nthread = 1, nrounds = nrounds, verbose = 0,
objective = "binary:logistic", booster = "gblinear")
objective = "binary:logistic", booster = "gblinear",
base_score = 0.5)

feature.names <- colnames(sparse_matrix)
}
Expand Down Expand Up @@ -360,7 +362,8 @@ test_that("xgb.importance works with and without feature names", {
m <- xgboost::xgboost(
data = as.matrix(data.frame(x = c(0, 1))),
label = c(1, 2),
nrounds = 1
nrounds = 1,
base_score = 0.5
)
df <- xgb.model.dt.tree(model = m)
expect_equal(df$Feature, "Leaf")
Expand Down
32 changes: 19 additions & 13 deletions demo/guide-python/feature_weights.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'''
"""
Demo for using feature weight to change column sampling
=======================================================

.. versionadded:: 1.3.0
'''
"""

import argparse

Expand All @@ -13,10 +13,10 @@
import xgboost


def main(args):
def main(args: argparse.Namespace) -> None:
rng = np.random.RandomState(1994)

kRows = 1000
kRows = 4196
kCols = 10

X = rng.randn(kRows, kCols)
Expand All @@ -28,26 +28,32 @@ def main(args):
dtrain = xgboost.DMatrix(X, y)
dtrain.set_info(feature_weights=fw)

bst = xgboost.train({'tree_method': 'hist',
'colsample_bynode': 0.2},
dtrain, num_boost_round=10,
evals=[(dtrain, 'd')])
# Perform column sampling for each node split evaluation, the sampling process is
# weighted by feature weights.
bst = xgboost.train(
{"tree_method": "hist", "colsample_bynode": 0.2},
dtrain,
num_boost_round=10,
evals=[(dtrain, "d")],
)
feature_map = bst.get_fscore()

# feature zero has 0 weight
assert feature_map.get('f0', None) is None
assert max(feature_map.values()) == feature_map.get('f9')
assert feature_map.get("f0", None) is None
assert max(feature_map.values()) == feature_map.get("f9")

if args.plot:
xgboost.plot_importance(bst)
plt.show()


if __name__ == '__main__':
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
'--plot',
"--plot",
type=int,
default=1,
help='Set to 0 to disable plotting the evaluation history.')
help="Set to 0 to disable plotting the evaluation history.",
)
args = parser.parse_args()
main(args)
13 changes: 9 additions & 4 deletions demo/guide-python/sklearn_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
if __name__ == "__main__":
print("Parallel Parameter optimization")
X, y = fetch_california_housing(return_X_y=True)
xgb_model = xgb.XGBRegressor(n_jobs=multiprocessing.cpu_count() // 2)
clf = GridSearchCV(xgb_model, {'max_depth': [2, 4, 6],
'n_estimators': [50, 100, 200]}, verbose=1,
n_jobs=2)
xgb_model = xgb.XGBRegressor(
n_jobs=multiprocessing.cpu_count() // 2, tree_method="hist"
)
clf = GridSearchCV(
xgb_model,
{"max_depth": [2, 4, 6], "n_estimators": [50, 100, 200]},
verbose=1,
n_jobs=2,
)
clf.fit(X, y)
print(clf.best_score_)
print(clf.best_params_)
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ class XGBoostClassifierSuite extends FunSuite with PerTest with TmpFolderPerSuit
"eta" -> "1",
"max_depth" -> "6",
"silent" -> "1",
"base_score" -> 0.5,
"objective" -> "binary:logistic",
"tree_method" -> treeMethod,
"max_bin" -> 16)

val model1 = ScalaXGBoost.train(trainingDM, paramMap, round)
val prediction1 = model1.predict(testDM)

Expand Down Expand Up @@ -453,5 +453,4 @@ class XGBoostClassifierSuite extends FunSuite with PerTest with TmpFolderPerSuit
assert(!compareTwoFiles(new File(modelJsonPath, "data/XGBoostClassificationModel").getPath,
nativeUbjModelPath))
}

}
4 changes: 2 additions & 2 deletions python-package/xgboost/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ def predict(
validate_features: bool = True,
base_margin: Optional[ArrayLike] = None,
iteration_range: Optional[Tuple[int, int]] = None,
) -> np.ndarray:
) -> ArrayLike:
"""Predict with `X`. If the model is trained with early stopping, then `best_iteration`
is used automatically. For tree models, when data is on GPU, like cupy array or
cuDF dataframe and `predictor` is not specified, the prediction is run on GPU
Expand Down Expand Up @@ -1520,7 +1520,7 @@ def predict(
validate_features: bool = True,
base_margin: Optional[ArrayLike] = None,
iteration_range: Optional[Tuple[int, int]] = None,
) -> np.ndarray:
) -> ArrayLike:
with config_context(verbosity=self.verbosity):
class_probs = super().predict(
X=X,
Expand Down
54 changes: 54 additions & 0 deletions python-package/xgboost/testing/dask.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""Tests for dask shared by different test modules."""
import numpy as np
from dask import array as da
from distributed import Client
from xgboost.testing.updater import get_basescore

import xgboost as xgb


def check_init_estimation_clf(tree_method: str, client: Client) -> None:
"""Test init estimation for classsifier."""
from sklearn.datasets import make_classification

X, y = make_classification(n_samples=4096 * 2, n_features=32, random_state=1994)
clf = xgb.XGBClassifier(n_estimators=1, max_depth=1, tree_method=tree_method)
clf.fit(X, y)
base_score = get_basescore(clf)

dx = da.from_array(X).rechunk(chunks=(32, None))
dy = da.from_array(y).rechunk(chunks=(32,))
dclf = xgb.dask.DaskXGBClassifier(
n_estimators=1, max_depth=1, tree_method=tree_method
)
dclf.client = client
dclf.fit(dx, dy)
dbase_score = get_basescore(dclf)
np.testing.assert_allclose(base_score, dbase_score)


def check_init_estimation_reg(tree_method: str, client: Client) -> None:
"""Test init estimation for regressor."""
from sklearn.datasets import make_regression

# pylint: disable=unbalanced-tuple-unpacking
X, y = make_regression(n_samples=4096 * 2, n_features=32, random_state=1994)
reg = xgb.XGBRegressor(n_estimators=1, max_depth=1, tree_method=tree_method)
reg.fit(X, y)
base_score = get_basescore(reg)

dx = da.from_array(X).rechunk(chunks=(32, None))
dy = da.from_array(y).rechunk(chunks=(32,))
dreg = xgb.dask.DaskXGBRegressor(
n_estimators=1, max_depth=1, tree_method=tree_method
)
dreg.client = client
dreg.fit(dx, dy)
dbase_score = get_basescore(dreg)
np.testing.assert_allclose(base_score, dbase_score)


def check_init_estimation(tree_method: str, client: Client) -> None:
"""Test init estimation."""
check_init_estimation_reg(tree_method, client)
check_init_estimation_clf(tree_method, client)
70 changes: 70 additions & 0 deletions python-package/xgboost/testing/updater.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
"""Tests for updaters."""
import json

import numpy as np

import xgboost as xgb


def get_basescore(model: xgb.XGBModel) -> float:
"""Get base score from an XGBoost sklearn estimator."""
base_score = float(
json.loads(model.get_booster().save_config())["learner"]["learner_model_param"][
"base_score"
]
)
return base_score


def check_init_estimation(tree_method: str) -> None:
"""Test for init estimation."""
from sklearn.datasets import (
make_classification,
make_multilabel_classification,
make_regression,
)

def run_reg(X: np.ndarray, y: np.ndarray) -> None: # pylint: disable=invalid-name
reg = xgb.XGBRegressor(tree_method=tree_method, max_depth=1, n_estimators=1)
reg.fit(X, y, eval_set=[(X, y)])
base_score_0 = get_basescore(reg)
score_0 = reg.evals_result()["validation_0"]["rmse"][0]

reg = xgb.XGBRegressor(
tree_method=tree_method, max_depth=1, n_estimators=1, boost_from_average=0
)
reg.fit(X, y, eval_set=[(X, y)])
base_score_1 = get_basescore(reg)
score_1 = reg.evals_result()["validation_0"]["rmse"][0]
assert not np.isclose(base_score_0, base_score_1)
assert score_0 < score_1 # should be better

# pylint: disable=unbalanced-tuple-unpacking
X, y = make_regression(n_samples=4096, random_state=17)
run_reg(X, y)
# pylint: disable=unbalanced-tuple-unpacking
X, y = make_regression(n_samples=4096, n_targets=3, random_state=17)
run_reg(X, y)

def run_clf(X: np.ndarray, y: np.ndarray) -> None: # pylint: disable=invalid-name
clf = xgb.XGBClassifier(tree_method=tree_method, max_depth=1, n_estimators=1)
clf.fit(X, y, eval_set=[(X, y)])
base_score_0 = get_basescore(clf)
score_0 = clf.evals_result()["validation_0"]["logloss"][0]

clf = xgb.XGBClassifier(
tree_method=tree_method, max_depth=1, n_estimators=1, boost_from_average=0
)
clf.fit(X, y, eval_set=[(X, y)])
base_score_1 = get_basescore(clf)
score_1 = clf.evals_result()["validation_0"]["logloss"][0]
assert not np.isclose(base_score_0, base_score_1)
assert score_0 < score_1 # should be better

# pylint: disable=unbalanced-tuple-unpacking
X, y = make_classification(n_samples=4096, random_state=17)
run_clf(X, y)
X, y = make_multilabel_classification(
n_samples=4096, n_labels=3, n_classes=5, random_state=17
)
run_clf(X, y)
2 changes: 1 addition & 1 deletion src/collective/rabit_communicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class RabitCommunicator : public Communicator {
}

template <typename DType, std::enable_if_t<std::is_floating_point<DType>::value> * = nullptr>
void DoBitwiseAllReduce(void *send_receive_buffer, std::size_t count, Operation op) {
void DoBitwiseAllReduce(void *, std::size_t, Operation) {
LOG(FATAL) << "Floating point types do not support bitwise operations.";
}

Expand Down
2 changes: 1 addition & 1 deletion src/data/data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ void MetaInfo::Extend(MetaInfo const& that, bool accumulate_rows, bool check_col
}
}

void MetaInfo::Validate(int32_t device) const {
void MetaInfo::Validate(std::int32_t device) const {
if (group_ptr_.size() != 0 && weights_.Size() != 0) {
CHECK_EQ(group_ptr_.size(), weights_.Size() + 1)
<< "Size of weights must equal to number of groups when ranking "
Expand Down
2 changes: 1 addition & 1 deletion src/data/gradient_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "../common/hist_util.h"
#include "../common/numeric.h"
#include "../common/threading_utils.h"
#include "../common/transform_iterator.h" // MakeIndexTransformIter
#include "../common/transform_iterator.h" // common::MakeIndexTransformIter
#include "adapter.h"
#include "proxy_dmatrix.h"
#include "xgboost/base.h"
Expand Down
Loading