Skip to content

Commit 6e3b9db

Browse files
authored
[python-package] fix _validate_feature_info() error message, other small fixes (#12142)
1 parent b2f15e6 commit 6e3b9db

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

python-package/xgboost/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def _validate_feature_info(
163163
feature_info = list(feature_info)
164164
if len(feature_info) != n_features and n_features != 0 and not is_column_split:
165165
msg = (
166-
f"{name} must have the same length as the number of data columns, ",
166+
f"{name} must have the same length as the number of data columns, "
167167
f"expected {n_features}, got {len(feature_info)}",
168168
)
169169
raise ValueError(msg)

python-package/xgboost/plotting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def to_graphviz(
266266

267267
if num_trees is not None:
268268
warnings.warn(
269-
"The `num_trees` parameter is deprecated, use `tree_idx` insetad. ",
269+
"The `num_trees` parameter is deprecated, use `tree_idx` instead. ",
270270
FutureWarning,
271271
)
272272
if tree_idx not in (0, num_trees):

python-package/xgboost/training.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def best_iteration(self) -> int:
281281

282282
@best_iteration.setter
283283
def best_iteration(self, iteration: int) -> None:
284-
"""Get best_iteration"""
284+
"""Set best_iteration"""
285285
self.set_attr(best_iteration=iteration)
286286

287287
@property
@@ -439,7 +439,7 @@ def cv(
439439
*,
440440
nfold: int = 3,
441441
stratified: bool = False,
442-
folds: XGBStratifiedKFold = None,
442+
folds: Optional[XGBStratifiedKFold] = None,
443443
metrics: Sequence[str] = (),
444444
obj: Optional[PlainObj] = None,
445445
maximize: Optional[bool] = None,

0 commit comments

Comments
 (0)