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
498 stars 53 forks source link

Apply f1 score as metrics for training #101

Closed billynguyenlss closed 5 months ago

billynguyenlss commented 5 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 5 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(...).