"include/git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "89824a6c70f4a319c2b50ba03cd4320ff00c731e"
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, ...@@ -186,8 +186,7 @@ gbm = lgb.train(params,
num_boost_round=10, num_boost_round=10,
init_model=gbm, init_model=gbm,
fobj=loglikelihood, fobj=loglikelihood,
feval=lambda preds, train_data: [binary_error(preds, train_data), feval=[binary_error, accuracy],
accuracy(preds, train_data)],
valid_sets=lgb_eval) valid_sets=lgb_eval)
print('Finished 50 - 60 rounds with self-defined objective function ' print('Finished 50 - 60 rounds with self-defined objective function '
......
...@@ -62,7 +62,7 @@ print('Starting training with multiple custom eval functions...') ...@@ -62,7 +62,7 @@ print('Starting training with multiple custom eval functions...')
# train # train
gbm.fit(X_train, y_train, gbm.fit(X_train, y_train,
eval_set=[(X_test, y_test)], 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) early_stopping_rounds=5)
print('Starting predicting...') 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