@@ -86,7 +86,7 @@ def fbeta(
86
86
Computes f_beta metric.
87
87
88
88
.. math::
89
- F_\beta = (1 + \beta^2) * \frac{\text{precision} * \text{recall}}
89
+ F_{ \beta} = (1 + \beta^2) * \frac{\text{precision} * \text{recall}}
90
90
{(\beta^2 * \text{precision}) + \text{recall}}
91
91
92
92
Works with binary, multiclass, and multilabel data.
@@ -108,15 +108,15 @@ def fbeta(
108
108
average:
109
109
Defines the reduction that is applied. Should be one of the following:
110
110
111
- - ``'micro'`` [default]: Calculate the metric globally, accross all samples and classes.
112
- - ``'macro'``: Calculate the metric for each class separately, and average the
113
- metrics accross classes (with equal weights for each class).
114
- - ``'weighted'``: Calculate the metric for each class separately, and average the
115
- metrics accross classes, weighting each class by its support (``tp + fn``).
116
- - ``'none'`` or ``None``: Calculate the metric for each class separately, and return
117
- the metric for every class.
118
- - ``'samples'``: Calculate the metric for each sample, and average the metrics
119
- across samples (with equal weights for each sample).
111
+ - ``'micro'`` [default]: Calculate the metric globally, accross all samples and classes.
112
+ - ``'macro'``: Calculate the metric for each class separately, and average the
113
+ metrics accross classes (with equal weights for each class).
114
+ - ``'weighted'``: Calculate the metric for each class separately, and average the
115
+ metrics accross classes, weighting each class by its support (``tp + fn``).
116
+ - ``'none'`` or ``None``: Calculate the metric for each class separately, and return
117
+ the metric for every class.
118
+ - ``'samples'``: Calculate the metric for each sample, and average the metrics
119
+ across samples (with equal weights for each sample).
120
120
121
121
.. note:: What is considered a sample in the multi-dimensional multi-class case
122
122
depends on the value of ``mdmc_average``.
@@ -125,38 +125,32 @@ def fbeta(
125
125
Defines how averaging is done for multi-dimensional multi-class inputs (on top of the
126
126
``average`` parameter). Should be one of the following:
127
127
128
- - ``None`` [default]: Should be left unchanged if your data is not multi-dimensional
129
- multi-class.
130
-
131
- - ``'samplewise'``: In this case, the statistics are computed separately for each
132
- sample on the ``N`` axis, and then averaged over samples.
133
- The computation for each sample is done by treating the flattened extra axes ``...``
134
- (see :ref:`references/modules:input types`) as the ``N`` dimension within the sample,
135
- and computing the metric for the sample based on that.
136
-
137
- - ``'global'``: In this case the ``N`` and ``...`` dimensions of the inputs
138
- (see :ref:`references/modules:input types`)
139
- are flattened into a new ``N_X`` sample axis, i.e. the inputs are treated as if they
140
- were ``(N_X, C)``. From here on the ``average`` parameter applies as usual.
128
+ - ``None`` [default]: Should be left unchanged if your data is not multi-dimensional
129
+ multi-class.
130
+ - ``'samplewise'``: In this case, the statistics are computed separately for each
131
+ sample on the ``N`` axis, and then averaged over samples.
132
+ The computation for each sample is done by treating the flattened extra axes ``...``
133
+ (see :ref:`references/modules:input types`) as the ``N`` dimension within the sample,
134
+ and computing the metric for the sample based on that.
135
+ - ``'global'``: In this case the ``N`` and ``...`` dimensions of the inputs
136
+ (see :ref:`references/modules:input types`)
137
+ are flattened into a new ``N_X`` sample axis, i.e. the inputs are treated as if they
138
+ were ``(N_X, C)``. From here on the ``average`` parameter applies as usual.
141
139
142
140
ignore_index:
143
141
Integer specifying a target class to ignore. If given, this class index does not contribute
144
142
to the returned score, regardless of reduction method. If an index is ignored, and ``average=None``
145
143
or ``'none'``, the score for the ignored class will be returned as ``nan``.
146
-
147
144
num_classes:
148
145
Number of classes. Necessary for ``'macro'``, ``'weighted'`` and ``None`` average methods.
149
-
150
146
threshold:
151
147
Threshold probability value for transforming probability predictions to binary
152
148
(0,1) predictions, in the case of binary or multi-label inputs.
153
149
top_k:
154
150
Number of highest probability entries for each sample to convert to 1s - relevant
155
151
only for inputs with probability predictions. If this parameter is set for multi-label
156
152
inputs, it will take precedence over ``threshold``. For (multi-dim) multi-class inputs,
157
- this parameter defaults to 1.
158
-
159
- Should be left unset (``None``) for inputs with label predictions.
153
+ this parameter defaults to 1. Should be left unset (``None``) for inputs with label predictions.
160
154
is_multiclass:
161
155
Used only in certain special cases, where you want to treat inputs as a different type
162
156
than what they appear to be. See the parameter's
0 commit comments