question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

is lightGBM custom eval metric usage possible?

See original GitHub issue

Hi,

Is a custom eval metric function usable with Optuna?

As the eval metric argument of LightGBMPruningCallback type is a string, I can’t make it work.

Thanks and keep the good work!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
smlycommented, Jan 30, 2020

Hi @flamby,

Thanks for the good question! I wrote an example code to use a custom metric function with Optuna. https://gist.github.com/smly/5a5ddf968d59492b79e4cbf90b2d3430

Hope this code helps to solve your problem.

1reaction
flambycommented, Jan 30, 2020

Thanks for the clarification @smly

and keep the good work!

closing then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to customize the metric function in lightgbm such as ks?
For custom evaluation metric: Python: https://github.com/Microsoft/LightGBM/blob/master/examples/python-guide/advanced_example.py ...
Read more >
Provide Additional Custom Metric to LightGBM for Early ...
This is on version 3.2.1. On version 3.0.0, it seems like it's totally impossible to pass multiple custom evaluation metrics in the training...
Read more >
Pass a custom evaluation metric to LightGBM | by Marco Gorelli
We learned how to pass a custom evaluation metric to LightGBM. This is useful when you have a task with an unusual evaluation...
Read more >
Example of LGBM Custom Metric - Kaggle
Example of LGBM Custom Metric ... pandas as pd import category_encoders as ce from sklearn.model_selection import StratifiedKFold import lightgbm as lgb.
Read more >
Parameters — LightGBM 3.3.3.99 documentation
LightGBM allows you to provide multiple evaluation metrics. Set this to true , if you want to use only the first metric for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found