microsoft / FLAML

A fast library for AutoML and tuning. Join our Discord: https://discord.gg/Cppx2vSPVP.
https://microsoft.github.io/FLAML/
MIT License
3.76k stars 495 forks source link

Question about the custom metric #1261

Closed xpye98 closed 5 months ago

xpye98 commented 6 months ago

Hi all,

The site here shows an example of how we can use custom metric for FLAML, and the alpha in def custom_metric seems a weight value for training and validating set.

alpha = 0.5
    return val_loss * (1 + alpha) - alpha * train_loss, {
        "val_loss": val_loss,
        "train_loss": train_loss,
        "pred_time": pred_time,
}

My question is that for default built-in metrics, say, accuracy for binary classification, what is the alpha? Is it zero, which means we only use validation information, or the opposite, we don't use validation loss at all?

What I want to do is to create a f2 score like the built-in f1 score, but I don't know how to decide the alpha as shown in the example.

Thank you very much!

sonichi commented 6 months ago

It's 0.

xpye98 commented 5 months ago

Thank you