1
Logistic损失函数的梯度
我想问一个与此有关的问题。 我在这里找到了为xgboost编写自定义损失函数的示例: loglossobj <- function(preds, dtrain) { # dtrain is the internal format of the training data # We extract the labels from the training data labels <- getinfo(dtrain, "label") # We compute the 1st and 2nd gradient, as grad and hess preds <- 1/(1 + exp(-preds)) grad <- preds …