diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e4af03c62..7f86d2a16 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -71,3 +71,4 @@ List of Contributors - Rory is the author of the GPU plugin and also contributed the cmake build system and windows continuous integration * [Gideon Whitehead](https://github.com/gaw89) * [Yi-Lin Juang](https://github.com/frankyjuang) +* [Andrew Hannigan](https://github.com/andrewhannigan) diff --git a/python-package/xgboost/sklearn.py b/python-package/xgboost/sklearn.py index 7216f68f8..57514cc28 100644 --- a/python-package/xgboost/sklearn.py +++ b/python-package/xgboost/sklearn.py @@ -195,14 +195,14 @@ class XGBModel(XGBModelBase): """Get xgboost type parameters.""" xgb_params = self.get_params() random_state = xgb_params.pop('random_state') - if xgb_params['seed'] is not None: + if 'seed' in xgb_params and xgb_params['seed'] is not None: warnings.warn('The seed parameter is deprecated as of version .6.' 'Please use random_state instead.' 'seed is deprecated.', DeprecationWarning) else: xgb_params['seed'] = random_state n_jobs = xgb_params.pop('n_jobs') - if xgb_params['nthread'] is not None: + if 'nthread' in xgb_params and xgb_params['nthread'] is not None: warnings.warn('The nthread parameter is deprecated as of version .6.' 'Please use n_jobs instead.' 'nthread is deprecated.', DeprecationWarning)