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

[jvm-packages] Refactor XGBoost.scala to put all params processing in one place #4815

Merged
merged 8 commits into from
Aug 29, 2019

Conversation

CodingCat
Copy link
Member

several pattern matching needs to be changed when adding a new param now, e.g. #4805

this PR is to refactor XGBoost.scala to make code cleaner

@CodingCat CodingCat changed the title [jvm-packages] Refactor xgboost native param [WIP][jvm-packages] Refactor xgboost native param Aug 28, 2019
@CodingCat CodingCat changed the title [WIP][jvm-packages] Refactor xgboost native param [WIP][jvm-packages] Refactor XGBoost.scala to put all params processing in one place Aug 28, 2019
if (overridedParams.contains("nthread")) {
val nThread = overridedParams("nthread").toString.toInt
require(nThread <= coresPerTask,
s"the nthread configuration ($nThread) must be no larger than " +
Copy link
Member

Choose a reason for hiding this comment

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

Reasonable, but why is it a requirement?

Copy link
Member Author

Choose a reason for hiding this comment

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

the logic is nthread are threads used by xgb to train

coresPerTasks is how many cores allocated to each task by cluster manager,

so nthread > coresPerTasks does not make sense

if (numEarlyStoppingRounds > 0 &&
!overridedParams.contains("maximize_evaluation_metrics")) {
if (overridedParams.contains("custom_eval")) {
throw new IllegalArgumentException("custom_eval does not support early stopping")
Copy link
Member

Choose a reason for hiding this comment

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

What's hurdle for supporting it?

Copy link
Member Author

Choose a reason for hiding this comment

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

we need a mechanism to support metrics sync, but we didn't reach to the agreement

validateSparkSslConf

if (overridedParams.contains("tree_method")) {
require(overridedParams("tree_method") == "hist" ||
Copy link
Member

Choose a reason for hiding this comment

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

I think we have gpu hist now. But sure when it can be upstreamed. Just trying to take a note.

Copy link
Member Author

Choose a reason for hiding this comment

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

nice

@CodingCat CodingCat changed the title [WIP][jvm-packages] Refactor XGBoost.scala to put all params processing in one place [jvm-packages] Refactor XGBoost.scala to put all params processing in one place Aug 29, 2019
@CodingCat CodingCat merged commit 0184eb5 into dmlc:master Aug 29, 2019
@CodingCat CodingCat deleted the refactor_xgboost_native_param branch August 29, 2019 05:41
@lock lock bot locked as resolved and limited conversation to collaborators Nov 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants