google / yggdrasil-decision-forests

A library to train, evaluate, interpret, and productionize decision forest models such as Random Forest and Gradient Boosted Decision Trees.
https://ydf.readthedocs.io/
Apache License 2.0
473 stars 49 forks source link

Apply f1 score as metrics for training #101

Closed billynguyenlss closed 3 months ago

billynguyenlss commented 3 months ago

How could I apply f1_score in my training procedure? I can do it with tfdf, but could not find similar API in ydf. Thanks for your help.

achoum commented 3 months ago

YDF currently does not compute and report the F1 score.

This could be a feature request.

In the meantime, YDF tends to play well with other ML frameworks. You can for example use sklearn f1 evaluation code or the keras one on the output of YDF's model.predict(...).