def det_cat_fct(pred, obs, thr, scores="", axis=None):
    """
    Calculate simple and skill scores for deterministic categorical
    (dichotomous) forecasts.

    Parameters
    ----------
    pred: array_like
        Array of predictions. NaNs are ignored.
    obs: array_like
        Array of verifying observations. NaNs are ignored.
    thr: float
        The threshold that is applied to predictions and observations in order
        to define events vs no events (yes/no).
    scores: {string, list of strings}, optional
        The name(s) of the scores. The default, scores="", will compute all
        available scores.
        The available score names are:

        .. tabularcolumns:: |p{2cm}|L|

        +------------+--------------------------------------------------------+
        | Name       | Description                                            |
        +============+========================================================+
        |  ACC       | accuracy (proportion correct)                          |
        +------------+--------------------------------------------------------+
        |  BIAS      | frequency bias                                         |
        +------------+--------------------------------------------------------+
        |  CSI       | critical success index (threat score)                  |
        +------------+--------------------------------------------------------+
        |  ETS       | equitable threat score                                 |
        +------------+--------------------------------------------------------+
        |  F1        | the harmonic mean of precision and sensitivity         |
        +------------+--------------------------------------------------------+
        |  FA        | false alarm rate (prob. of false detection, fall-out,  |
        |            | false positive rate)                                   |
        +------------+--------------------------------------------------------+
        |  FAR       | false alarm ratio (false discovery rate)               |
        +------------+--------------------------------------------------------+
        |  GSS       | Gilbert skill score (equitable threat score)           |
        +------------+--------------------------------------------------------+
        |  HK        | Hanssen-Kuipers discriminant (Pierce skill score)      |
        +------------+--------------------------------------------------------+
        |  HSS       | Heidke skill score                                     |
        +------------+--------------------------------------------------------+
        |  MCC       | Matthews correlation coefficient                       |
        +------------+--------------------------------------------------------+
        |  POD       | probability of detection (hit rate, sensitivity,       |
        |            | recall, true positive rate)                            |
        +------------+--------------------------------------------------------+
        |  SEDI      | symmetric extremal dependency index                    |
        +------------+--------------------------------------------------------+

    axis: None or int or tuple of ints, optional
        Axis or axes along which a score is integrated. The default, axis=None,
        will integrate all of the elements of the input arrays.\n
        If axis is -1 (or any negative integer),
        the integration is not performed
        and scores are computed on all of the elements in the input arrays.\n
        If axis is a tuple of ints, the integration is performed on all of the
        axes specified in the tuple.

    Returns
    -------
    result: dict
        Dictionary containing the verification results.

    See also
    --------
    pysteps.verification.detcontscores.det_cont_fct
    """

    contab = det_cat_fct_init(thr, axis)
    det_cat_fct_accum(contab, pred, obs)
    return det_cat_fct_compute(contab, scores)
Calculate simple and skill scores for deterministic categorical
(dichotomous) forecasts.

Parameters
----------
pred: array_like
Array of predictions. NaNs are ignored.
obs: array_like
Array of verifying observations. NaNs are ignored.
thr: float
The threshold that is applied to predictions and observations in order
to define events vs no events (yes/no).
scores: {string, list of strings}, optional
The name(s) of the scores. The default, scores="", will compute all
available scores.
The available score names are:

.. tabularcolumns:: |p{2cm}|L|

+------------+--------------------------------------------------------+
| Name       | Description                                            |
+============+========================================================+
|  ACC       | accuracy (proportion correct)                          |
+------------+--------------------------------------------------------+
|  BIAS      | frequency bias                                         |
+------------+--------------------------------------------------------+
|  CSI       | critical success index (threat score)                  |
+------------+--------------------------------------------------------+
|  ETS       | equitable threat score                                 |
+------------+--------------------------------------------------------+
|  F1        | the harmonic mean of precision and sensitivity         |
+------------+--------------------------------------------------------+
|  FA        | false alarm rate (prob. of false detection, fall-out,  |
|            | false positive rate)                                   |
+------------+--------------------------------------------------------+
|  FAR       | false alarm ratio (false discovery rate)               |
+------------+--------------------------------------------------------+
|  GSS       | Gilbert skill score (equitable threat score)           |
+------------+--------------------------------------------------------+
|  HK        | Hanssen-Kuipers discriminant (Pierce skill score)      |
+------------+--------------------------------------------------------+
|  HSS       | Heidke skill score                                     |
+------------+--------------------------------------------------------+
|  MCC       | Matthews correlation coefficient                       |
+------------+--------------------------------------------------------+
|  POD       | probability of detection (hit rate, sensitivity,       |
|            | recall, true positive rate)                            |
+------------+--------------------------------------------------------+
|  SEDI      | symmetric extremal dependency index                    |
+------------+--------------------------------------------------------+

axis: None or int or tuple of ints, optional
Axis or axes along which a score is integrated. The default, axis=None,
will integrate all of the elements of the input arrays.\n
If axis is -1 (or any negative integer),
the integration is not performed
and scores are computed on all of the elements in the input arrays.\n
If axis is a tuple of ints, the integration is performed on all of the
axes specified in the tuple.

Returns
-------
result: dict
Dictionary containing the verification results.

See also
--------
pysteps.verification.detcontscores.det_cont_fct
pysteps/verification/detcatscores.py