pyphi.models.explanation.runner_up_from_candidates#
- pyphi.models.explanation.runner_up_from_candidates(candidates, mip_value, key=None, normalized=False)[source]#
The candidate ranked next after the MIP under
key.keymaps a candidate to the quantity minimized at MIP selection (raw φ by default; pass the result ofsia_runner_up_key()to match a configured tie-resolution strategy).mip_valueis the MIP’s own key value. Candidates that tie the MIP (withinpyphi.numerics.eq()) are tied peers, not runners-up, so they are excluded. ReturnsNonewhen no candidate exceeds the MIP. Candidates tied for next-best are ordered bypartition.lex_key()so the choice does not depend on iteration order. Each candidate must expose.partitionand whateverkeyreads (.phiby default). The returned record’sgapis the runner-up’s key value minusmip_value.