Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dask] passed through verbose for dask fit #5413

Merged
merged 2 commits into from
Mar 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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