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

[python-package] limit when num_boost_round warnings are emitted (fixes #6324) #6579

Merged
merged 17 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
reorder param docs, remove commented-out code
  • Loading branch information
jameslamb committed Aug 28, 2024
commit e5de60ab0674eeb1ac0e4dc03f2b201d624d2d79
4 changes: 2 additions & 2 deletions docs/Parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Parameters Format
Parameters are merged together in the following order (later items overwrite earlier ones):

1. LightGBM's default values
2. (CLI only) configuration in a file passed like ``config=train.conf``
3. special files for ``weight``, ``init_score``, ``query``, and ``positions`` (see `Others <#others>`__)
2. special files for ``weight``, ``init_score``, ``query``, and ``positions`` (see `Others <#others>`__)
3. (CLI only) configuration in a file passed like ``config=train.conf``
4. (CLI only) configuration passed via the command line
5. (Python, R) special keyword arguments to some functions (e.g. ``num_boost_round`` in ``train()``)
6. (Python, R) ``params`` function argument (including ``**kwargs`` in Python and ``...`` in R)
Expand Down
2 changes: 0 additions & 2 deletions tests/python_package_test/test_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -1376,8 +1376,6 @@ def test_fit_only_raises_num_rounds_warning_when_expected(capsys):
assert_silent(capsys)

# warning: 2 aliases (different values... "num_iterations" wins because it's the main param name)
# with pytest.warns(UserWarning, match="LightGBM will perform up to 5 boosting rounds"):
# reg = lgb.LGBMRegressor(**base_kwargs, num_iterations=-8, n_iter=6).fit(X, y)
with pytest.warns(UserWarning, match="LightGBM will perform up to 5 boosting rounds"):
reg = lgb.LGBMRegressor(**base_kwargs, num_iterations=5, n_iter=6).fit(X, y)
assert reg.n_estimators_ == 5
Expand Down
Loading