Created
June 11, 2022 18:21
-
-
Save GDBSD/e4e9e921fbfce51a149e1fa9ec12fd28 to your computer and use it in GitHub Desktop.
Calculate F-Beta
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def calc_beta_f1(beta, precision, recall): | |
| """Calculate F-beta given the values for precision and recall and the beta value""" | |
| beta_sq = pow(beta, 2) | |
| num = (1 + beta_sq)*precision*recall | |
| denom = beta_sq*precision+recall | |
| return num/denom |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Useful if you're asked to calculate F Beta given only the precision and recall values.