eval_loss: Weighted mean of log loss (binary cross-entropy loss) for...

View source: R/wxgb.error.R

eval_lossR Documentation

Weighted mean of log loss (binary cross-entropy loss) for complex survey data

Description

A function to evaluate XGBoost models by weighted mean log loss for logistic regression. This function estimates predicted probabilities from the predicted binary outcomes and computes the weighted mean of log likelihood values for Bernoulli distribution. This function is a customized error function for complex survey data.

Usage

eval_loss(preds, dtrain)

Arguments

preds

Predicted binary values (0/1) from the model.

dtrain

An object of xgb.DMatrix including label(response variable or binary outcome), data,weight.

Value

A list of two components:

  • metric: A string labelled as weighted.mean.logloss.

  • value : A numeric value of weighted mean of log loss.

See Also

xgboost::xgb.train() for relevant arguments and return values in detail.

wXGBoost() for detailed information on implementation.

optim_wxgb_para() for detailed optimization and examples.


MLSurvey documentation built on Nov. 18, 2026, 5:11 p.m.