ntqr.r2.evaluations
===================

.. py:module:: ntqr.r2.evaluations

.. autoapi-nested-parse::

   Evaluations for binary tests (R=2).

   For any finite test there is a finite set of evaluations possible. The
   classes in this module compute them.

   Classes:
       SingleClassifierEvaluations: Class related to the evaluations for a
       single classifier consistent with its observed test responses.

   Functions:

   Misc variables:



Classes
-------

.. autoapisummary::

   ntqr.r2.evaluations.SingleClassifierEvaluations
   ntqr.r2.evaluations.PosteriorSingleEvaluations


Module Contents
---------------

.. py:class:: SingleClassifierEvaluations(Q, single_axioms)

   Bases: :py:obj:`ntqr.evaluations.SingleClassifierEvaluations`


   Single classifier evaluations in (Q_a, Q_b, R_{b_i, a}, R_{a_i,b}) space.

   Deprecated class.


   .. py:method:: number_apriori_evaluations()

      Calculate all the possible evaluations for a binary response test.

      :rtype: int



   .. py:method:: errors_at_qs(qs, responses)

      Return all evaluations logically consistent with responses.

      In binary classification we have Q_a + Q_b = Q. Thus, we
      really need to specify only two of the three (Q, Q_a, Q_b).
      Making a choice is arbitrary and breaks the symmetry in the
      algebra between the two labels. Instead, we specify Q_a, and
      Q_b and since we have Q from the instance initialization, we
      do a quality check (logic check) of the equality between the
      three quantities.



   .. py:method:: max_correct_at_qs(qs, responses)

      Gives highest performing correct for each label.

      Meant to save memory for alarm applications.



   .. py:method:: all_qs()

      Return all possible question numbers.



   .. py:method:: _label_wrongs_(ql)

      Return all possible incorrect given Q_l.



.. py:class:: PosteriorSingleEvaluations(tvc: ntqr.r2.datasketches.VoteCounts)

   Evaluations logically consistent with observed responses.


   .. py:attribute:: Q


   .. py:attribute:: tvc


   .. py:method:: all_possible_evaluations(classifier: int)


   .. py:method:: find_k_nearest_at_prevalence(classifier: int, qa: int, point, k: int)


   .. py:method:: find_k_nearest_at_prevalence_all_classifiers(qa: int, points, k: int)


   .. py:method:: distances_to_target(Qa, Raa, Rbb, point)


   .. py:method:: to_pspace(point)


