pub struct Ranking { /* private fields */ }Expand description
Sorted decided candidates and every unscored candidate’s evidence.
Implementations§
Source§impl Ranking
impl Ranking
Sourcepub fn ranked(&self) -> &[Ranked]
pub fn ranked(&self) -> &[Ranked]
Candidates sorted by descending score, with exact ties in retrieval order.
Sourcepub fn unscored(&self) -> &IndexMap<String, ItemResult>
pub fn unscored(&self) -> &IndexMap<String, ItemResult>
Undecided answers and provider failures, in retrieval order.
Sourcepub fn models(&self) -> BTreeSet<&str>
pub fn models(&self) -> BTreeSet<&str>
Nonempty model identities actually reported, including undecided answers.
Sourcepub fn top(&self, k: usize, allow_partial: bool) -> Result<&[Ranked]>
pub fn top(&self, k: usize, allow_partial: bool) -> Result<&[Ranked]>
Return at most k candidates, checking completeness and reported-model consistency.
allow_partial permits unscored candidates; it never permits mixed models.
Unknown model metadata stays unknown rather than claiming one common model.
§Errors
Returns InvalidArgument if candidates are unscored and allow_partial
is false, or if answers report more than one nonempty model identity.
The mixed-model check applies even when partial results are allowed.
Sourcepub fn reweighted(&self, weights: &[f64]) -> Result<Self>
pub fn reweighted(&self, weights: &[f64]) -> Result<Self>
Re-sort decided answers using finite strictly increasing rubric weights.
Uses normalized sum(weight * probability) / sum(probability) and retains
the original answers and unscored entries. No provider call occurs.
§Errors
Returns InvalidArgument if weights do not match the rubric length, are
nonfinite or not strictly increasing, or weighted arithmetic is nonfinite.