Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
116abc67
Unverified
Commit
116abc67
authored
Sep 08, 2020
by
Nikita Titov
Committed by
GitHub
Sep 08, 2020
Browse files
[python][examples] updated examples with multiple custom metrics (#3367)
parent
d3fb6c9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
examples/python-guide/advanced_example.py
examples/python-guide/advanced_example.py
+1
-2
examples/python-guide/sklearn_example.py
examples/python-guide/sklearn_example.py
+1
-1
No files found.
examples/python-guide/advanced_example.py
View file @
116abc67
...
...
@@ -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 '
...
...
examples/python-guide/sklearn_example.py
View file @
116abc67
...
...
@@ -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...'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment