nonconformist
nonconformist copied to clipboard
confidence and credibility
in https://github.com/donlnz/nonconformist/blob/cdef0d1fb9a512dbac912e735f417270d26564a9/nonconformist/cp.py#L169 with due attention to http://www.quantware.ups-tlse.fr/ecoleluchon2015/slides/luo.pdf compute the p-values p0 and p1 for both completions (with the tentative labels 0 and 1 for the new image, respectively); • if p0 is smaller [intuitively, 0 is a stranger label than 1], predict 1 with confidence 1 − p0 and credibility p1; • if p1 is smaller [intuitively, 1 is a stranger label than 0], predict 0 with confidence 1 − p1 and credibility p0.
must be changed to: confidence = 1 - p.min(axis=1)
I think this is managed by the previous lines of code.
The max values are set to -np.inf
. At that point:
- if you have 2 labels,
p.max(axis=1)
will actually be the minimum! - if you have more than 2 labels,
p.max(axis=1)
will return the second most likely label