Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
f175cebd
Unverified
Commit
f175cebd
authored
Oct 02, 2023
by
James Lamb
Committed by
GitHub
Oct 02, 2023
Browse files
[python-package] simplify Dataset._compare_params_for_warning() (#6120)
parent
63a882b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+4
-8
No files found.
python-package/lightgbm/basic.py
View file @
f175cebd
...
...
@@ -2200,8 +2200,8 @@ class Dataset:
@
staticmethod
def
_compare_params_for_warning
(
params
:
Optional
[
Dict
[
str
,
Any
]
]
,
other_params
:
Optional
[
Dict
[
str
,
Any
]
]
,
params
:
Dict
[
str
,
Any
],
other_params
:
Dict
[
str
,
Any
],
ignore_keys
:
Set
[
str
]
)
->
bool
:
"""Compare two dictionaries with params ignoring some keys.
...
...
@@ -2210,9 +2210,9 @@ class Dataset:
Parameters
----------
params : dict
or None
params : dict
One dictionary with parameters to compare.
other_params : dict
or None
other_params : dict
Another dictionary with parameters to compare.
ignore_keys : set
Keys that should be ignored during comparing two dictionaries.
...
...
@@ -2222,10 +2222,6 @@ class Dataset:
compare_result : bool
Returns whether two dictionaries with params are equal.
"""
if
params
is
None
:
params
=
{}
if
other_params
is
None
:
other_params
=
{}
for
k
in
other_params
:
if
k
not
in
ignore_keys
:
if
k
not
in
params
or
params
[
k
]
!=
other_params
[
k
]:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment