From bb8c8df39d75c07358abbb46f90142508d563459 Mon Sep 17 00:00:00 2001 From: Jan Borchmann Date: Fri, 13 Mar 2020 18:33:53 -0400 Subject: [PATCH] [dask] passed through verbose for dask fit (#5413) --- python-package/xgboost/dask.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/python-package/xgboost/dask.py b/python-package/xgboost/dask.py index fde1b1657663..017c101092b1 100644 --- a/python-package/xgboost/dask.py +++ b/python-package/xgboost/dask.py @@ -540,7 +540,8 @@ def fit(self, y, sample_weights=None, eval_set=None, - sample_weight_eval_set=None): + sample_weight_eval_set=None, + verbose=True): '''Fit the regressor. Parameters @@ -557,7 +558,10 @@ def fit(self, Validation metrics will help us track the performance of the model. sample_weight_eval_set : list, optional A list of the form [L_1, L_2, ..., L_n], where each L_i is a list - of group weights on the i-th validation set.''' + of group weights on the i-th validation set. + verbose : bool + If `verbose` and an evaluation set is used, writes the evaluation + metric measured on the validation set to stderr.''' raise NotImplementedError def predict(self, data): # pylint: disable=arguments-differ @@ -589,7 +593,8 @@ def fit(self, y, sample_weights=None, eval_set=None, - sample_weight_eval_set=None): + sample_weight_eval_set=None, + verbose=True): _assert_dask_support() dtrain = DaskDMatrix(client=self.client, data=X, label=y, weight=sample_weights) @@ -599,7 +604,7 @@ def fit(self, results = train(self.client, params, dtrain, num_boost_round=self.get_num_boosting_rounds(), - evals=evals) + evals=evals, verbose_eval=verbose) # pylint: disable=attribute-defined-outside-init self._Booster = results['booster'] # pylint: disable=attribute-defined-outside-init @@ -627,7 +632,8 @@ def fit(self, y, sample_weights=None, eval_set=None, - sample_weight_eval_set=None): + sample_weight_eval_set=None, + verbose=True): _assert_dask_support() dtrain = DaskDMatrix(client=self.client, data=X, label=y, weight=sample_weights) @@ -650,7 +656,7 @@ def fit(self, eval_set, sample_weight_eval_set) results = train(self.client, params, dtrain, num_boost_round=self.get_num_boosting_rounds(), - evals=evals) + evals=evals, verbose_eval=verbose) self._Booster = results['booster'] # pylint: disable=attribute-defined-outside-init self.evals_result_ = results['history']