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

[pyspark] add parameters in the ctor of all estimators. #9202

Merged
merged 13 commits into from
May 28, 2023

Conversation

wbo4958
Copy link
Contributor

@wbo4958 wbo4958 commented May 26, 2023

This PR adds parameters into estimators' __ init__ function and more doc.

@wbo4958
Copy link
Contributor Author

wbo4958 commented May 26, 2023

@WeichenXu123 @trivialfis could you help to review this PR?

Copy link
Contributor

@WeichenXu123 WeichenXu123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

force_repartition: bool = False,
repartition_random_shuffle: bool = False,
enable_sparse_data_optim: bool = False,
**xgboost_parameters: Dict[str, Any],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the convention of **kwargs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thx

Xgboost DMatrix object will be constructed from sparse matrix instead of
dense matrix.

xgboost_parameters:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

force_repartition: bool = False,
repartition_random_shuffle: bool = False,
enable_sparse_data_optim: bool = False,
**xgboost_parameters: Dict[str, Any],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

python-package/xgboost/spark/estimator.py Outdated Show resolved Hide resolved
python-package/xgboost/spark/estimator.py Outdated Show resolved Hide resolved
python-package/xgboost/spark/estimator.py Outdated Show resolved Hide resolved
To specify the base margins of the training and validation
dataset, set :py:attr:`xgboost.spark.SparkXGBClassifier.base_margin_col` parameter
instead of setting `base_margin` and `base_margin_eval_set` in the
`xgboost.XGBClassifier` fit method. Note: this isn't available for distributed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`xgboost.XGBClassifier` fit method. Note: this isn't available for distributed
:py:class:`xgboost.XGBClassifier` fit method. Note: this isn't available for distributed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by isn't available for distributed training?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. removed it.

base_margin_col:
To specify the base margins of the training and validation
dataset, set :py:attr:`xgboost.spark.SparkXGBClassifier.base_margin_col` parameter
instead of setting `base_margin` and `base_margin_eval_set` in the
`xgboost.XGBClassifier` fit method. Note: this isn't available for distributed
training.
qid_col"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
qid_col"
qid_col:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QID is only available for ranking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

Copy link
Member

@trivialfis trivialfis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can build the document using sphinx. Install the required packages listed in doc/requirements.txt using pip (or conda if you prefer), run make html under the doc directory, watch out for warnings during build, then you can view the html files.

python-package/xgboost/spark/estimator.py Outdated Show resolved Hide resolved
python-package/xgboost/spark/estimator.py Outdated Show resolved Hide resolved
python-package/xgboost/spark/estimator.py Outdated Show resolved Hide resolved
@trivialfis trivialfis merged commit 320323f into dmlc:master May 28, 2023
@wbo4958 wbo4958 deleted the init_params branch May 28, 2023 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants