Skip to content

Commit a48c7d8

Browse files
committed
fix base_score problem, tidymodels#65
1 parent 90df116 commit a48c7d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/model-xgboost.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ build_fit_formula_xgb <- function(parsedmodel) {
140140
assigned <- 1
141141
} else if (objective %in% c("binary:logistic", "reg:logistic")) {
142142
assigned <- 1
143-
f <- expr(1 - 1 / (1 + exp(!!f)))
143+
f <- expr(1 - 1 / (1 + exp(!!f + log(!!base_score/(1-!!base_score)))))
144144
}
145145
if (assigned == 0) {
146146
stop("Only objectives 'binary:logistic', 'reg:linear', 'reg:logistic', 'binary:logitraw' are supported yet.")

0 commit comments

Comments
 (0)