Skip to content

Commit

Permalink
[dask] passed through verbose for dask fit (#5413)
Browse files Browse the repository at this point in the history
  • Loading branch information
jborchma authored Mar 13, 2020
1 parent 45a97dd commit bb8c8df
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions python-package/xgboost/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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']
Expand Down

0 comments on commit bb8c8df

Please sign in to comment.