Skip to content

Commit ac31340

Browse files
committed
fix data load.
1 parent acd186e commit ac31340

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

python-package/xgboost/testing/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from concurrent.futures import ThreadPoolExecutor
1515
from contextlib import contextmanager
1616
from io import StringIO
17+
from pathlib import Path
1718
from platform import system
1819
from typing import (
1920
Any,
@@ -462,9 +463,9 @@ def get_mq2008(
462463
qid_valid,
463464
) = load_svmlight_files(
464465
(
465-
dpath + "MQ2008/Fold1/train.txt",
466-
dpath + "MQ2008/Fold1/test.txt",
467-
dpath + "MQ2008/Fold1/vali.txt",
466+
Path(dpath) / "MQ2008" / "Fold1" / "train.txt",
467+
Path(dpath) / "MQ2008" / "Fold1" / "test.txt",
468+
Path(dpath) / "MQ2008" / "Fold1" / "vali.txt",
468469
),
469470
query_id=True,
470471
zero_based=False,

src/objective/init_estimation.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
#include "xgboost/linalg.h" // Tensor
88
#include "xgboost/objective.h" // ObjFunction
99

10-
namespace xgboost {
11-
namespace obj {
10+
namespace xgboost::obj {
1211
class FitIntercept : public ObjFunction {
1312
void InitEstimation(MetaInfo const& info, linalg::Vector<float>* base_score) const override;
1413
};
@@ -20,6 +19,5 @@ inline void CheckInitInputs(MetaInfo const& info) {
2019
<< "Number of weights should be equal to number of data points.";
2120
}
2221
}
23-
} // namespace obj
24-
} // namespace xgboost
22+
} // namespace xgboost::obj
2523
#endif // XGBOOST_OBJECTIVE_INIT_ESTIMATION_H_

0 commit comments

Comments
 (0)