Skip to content

Commit

Permalink
chore: change xgboost default nrounds from 1 to 1000 (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc authored Aug 18, 2024
1 parent da24fe1 commit ced73d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions R/LearnerClassifXgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
#' @section Initial parameter values:
#' - `nrounds`:
#' - Actual default: no default.
#' - Adjusted default: 1.
#' - Reason for change: Without a default construction of the learner
#' would error. Just setting a nonsense default to workaround this.
#' `nrounds` needs to be tuned by the user.
#' - Adjusted default: 1000.
#' - Reason for change: Without a default construction of the learner would error.
#' The lightgbm learner has a default of 1000, so we use the same here.
#' - `nthread`:
#' - Actual value: Undefined, triggering auto-detection of the number of CPUs.
#' - Adjusted value: 1.
Expand Down Expand Up @@ -156,7 +155,7 @@ LearnerClassifXgboost = R6Class("LearnerClassifXgboost",
)

# custom defaults
ps$values = list(nrounds = 1L, nthread = 1L, verbose = 0L)
ps$values = list(nrounds = 1000L, nthread = 1L, verbose = 0L)

super$initialize(
id = "classif.xgboost",
Expand Down
2 changes: 1 addition & 1 deletion R/LearnerRegrXgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ LearnerRegrXgboost = R6Class("LearnerRegrXgboost",
# param deps

# custom defaults
ps$values = list(nrounds = 1L, nthread = 1L, verbose = 0L)
ps$values = list(nrounds = 1000L, nthread = 1L, verbose = 0L)

super$initialize(
id = "regr.xgboost",
Expand Down

0 comments on commit ced73d7

Please sign in to comment.