Skip to content

How to add custom_metric #477

Answered by sonichi
hanhanwu asked this question in Q&A
Mar 10, 2022 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Hello FLAML team,

I'm trying to do HPO with customized metrics. My customized metric does have the same signature ask this documentation requested: https://microsoft.github.io/FLAML/docs/reference/automl/

Here's my code:

But tried multiple settings, not sure where to add this customized metric in automl... Got this type of error:

Do you know how to solve this problem? It's kinda urgent for me... How to hear from you soon... Thank you!

Please change the signature into:

def custom_metric(
    X_val, y_val, estimator, labels,
    X_train, y_train, weight_val=None, weight_train=None,
    *args,
):

We'll update the documentation.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hanhanwu
Comment options

@sonichi
Comment options

@hanhanwu
Comment options

Answer selected by hanhanwu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants