From 93c2e72cc7b42c4dec4858babcb2e2a43c05c4dc Mon Sep 17 00:00:00 2001 From: hzy46 <362583303@qq.com> Date: Wed, 3 Nov 2021 16:51:30 +0800 Subject: [PATCH] fux --- python-package/lightgbm/basic.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python-package/lightgbm/basic.py b/python-package/lightgbm/basic.py index 9af3e680c732..812fd82a5d97 100644 --- a/python-package/lightgbm/basic.py +++ b/python-package/lightgbm/basic.py @@ -1769,7 +1769,8 @@ def __init_from_csc(self, csc, params_str, ref_dataset): @staticmethod def _compare_params_for_warning(params, other_params): - """ Compare params. + """Compare params. + It is only for the warning purpose. Thus some keys are ignored. Returns @@ -1778,6 +1779,10 @@ def _compare_params_for_warning(params, other_params): If they are equal, return True; Otherwise, return False. """ ignore_keys = _ConfigAliases.get("categorical_feature") + 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]: