Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F_b score #35

Closed
rsuwaileh opened this issue Jun 4, 2020 · 1 comment · Fixed by #54
Closed

F_b score #35

rsuwaileh opened this issue Jun 4, 2020 · 1 comment · Fixed by #54
Labels
enhancement New feature or request

Comments

@rsuwaileh
Copy link

rsuwaileh commented Jun 4, 2020

Hey,

Is it possible to add F_beta to the list of measures? This is in case I want to weight P or R more than the other?
F_b = (1 + b^2) * (precision * recall) / ((b^2 * precision) + recall)

F1 = 2 * (precision * recall) / (precision + recall)

score = (1 + b**2) * p * r / ((b**2 * p) + r) if p + r > 0 else 0

score = 2 * p * r / (p + r) if p + r > 0 else 0

@Hironsan Hironsan added the enhancement New feature or request label Sep 30, 2020
@Hironsan
Copy link
Member

As of v1.0.0, precision_recall_fscore_support function supports beta. You can calculate F-beta easily.

def precision_recall_fscore_support(y_true: List[List[str]],
y_pred: List[List[str]],
*,
average: Optional[str] = None,
warn_for=('precision', 'recall', 'f-score'),
beta: float = 1.0,
sample_weight=None,
zero_division: str = 'warn',
scheme: Type[Token] = None,
suffix: bool = False) -> SCORES:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants