I want to keep objective as "reg:linear" and eval_metric as customised rmse as follows.

def customised_rmse(preds, dtrain):
    N = len(preds)
    preds = np.array(preds)
    actual = np.array(dtrain.get_label())
    crmse = np.sqrt(np.sum(np.power((preds+1)*1.0/(actual+1) - 1.1, 2))/N)
    return "custom-rmse", crmse

When I ran, train function as follows ->

model = xgb.train(param_list, xgb_train, num_rounds, watchlist, None, customised_rmse, early_stopping_rounds=30)

Output I am getting is this ->

[0] train-rmse:15.1904  val-rmse:15.2102    train-custom-rmse:0.607681  val-custom-rmse:0.610993
Multiple eval metrics have been passed: 'val-custom-rmse' will be used for early stopping.
Will train until val-custom-rmse hasn't improved in 30 rounds.
[1] train-rmse:14.4936  val-rmse:14.5103    train-custom-rmse:0.588831  val-custom-rmse:0.589902

and so on ..

My question is, it is getting optimised using "rmse" or "custom-rase" or both ?? What I have to do to remove "rmse" as it comes by default with "reg:linear" ??


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.