Unverified Commit 116abc67 authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[python][examples] updated examples with multiple custom metrics (#3367)

parent d3fb6c9f
......@@ -186,8 +186,7 @@ gbm = lgb.train(params,
num_boost_round=10,
init_model=gbm,
fobj=loglikelihood,
feval=lambda preds, train_data: [binary_error(preds, train_data),
accuracy(preds, train_data)],
feval=[binary_error, accuracy],
valid_sets=lgb_eval)
print('Finished 50 - 60 rounds with self-defined objective function '
......
......@@ -62,7 +62,7 @@ print('Starting training with multiple custom eval functions...')
# train
gbm.fit(X_train, y_train,
eval_set=[(X_test, y_test)],
eval_metric=lambda y_true, y_pred: [rmsle(y_true, y_pred), rae(y_true, y_pred)],
eval_metric=[rmsle, rae],
early_stopping_rounds=5)
print('Starting predicting...')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment