BinaryF1Score metric
Bases: BinaryFBetaScore
F1 on boolean fields; use for imbalanced yes/no labels, not text.
Formula:
This is the harmonic mean of precision and recall.
Its output range is [0, 1]. It operates at a field level
and can be used for multi-class and multi-label classification.
Each field of y_true and y_pred should booleans or floats between [0, 1].
If the fields are floats, it uses the threshold for deciding
if the values are 0 or 1.
Example:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
average
|
str
|
Type of averaging to be performed across per-class results
in the multi-class case.
Acceptable values are |
None
|
threshold
|
float
|
(Optional) Float representing the threshold for deciding
whether prediction values are 1 or 0. Elements of |
0.5
|
name
|
str
|
(Optional) string name of the metric instance. |
'binary_f1_score'
|
in_mask
|
list
|
(Optional) list of keys to keep to compute the metric. |
None
|
out_mask
|
list
|
(Optional) list of keys to remove to compute the metric. |
None
|
in_mask_pattern
|
str
|
(Optional) Regex pattern; fields whose names match
are kept (combined with |
None
|
out_mask_pattern
|
str
|
(Optional) Regex pattern; fields whose names match
are dropped (combined with |
None
|
Source code in synalinks/src/metrics/f_score_metrics.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 | |
get_config()
Return the serializable config of the metric.
Returns:
| Type | Description |
|---|---|
dict
|
The config dict. |