BinaryF1Score metric
Bases: BinaryFBetaScore
Computes F-1 Score on binary structures.
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
629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 | |
get_config()
Return the serializable config of the metric.
Returns:
| Type | Description |
|---|---|
dict
|
The config dict. |