pub struct ConsensusReport<K> {
pub high_consensus: Vec<K>,
pub single_source: Vec<K>,
pub rank_disagreement: Vec<(K, Vec<(String, usize)>)>,
}Expand description
Analyze consensus patterns across retrievers.
Returns statistics about how retrievers agree or disagree on document relevance.
§Example
use rankops::explain::{rrf_explain, analyze_consensus, RetrieverId};
use rankops::RrfConfig;
let bm25 = vec![("d1", 12.5), ("d2", 11.0)];
let dense = vec![("d2", 0.9), ("d3", 0.8)];
let explained = rrf_explain(
&[&bm25[..], &dense[..]],
&[RetrieverId::new("bm25"), RetrieverId::new("dense")],
RrfConfig::default(),
);
let consensus = analyze_consensus(&explained);
// consensus.high_consensus contains documents in all retrievers
// consensus.single_source contains documents only in one retrieverFields§
§high_consensus: Vec<K>Documents that appeared in all retrievers (consensus_score == 1.0).
single_source: Vec<K>Documents that appeared in only one retriever (consensus_score < 0.5).
rank_disagreement: Vec<(K, Vec<(String, usize)>)>Documents with large rank disagreements across retrievers.
A document might appear at rank 0 in one retriever but rank 50 in another, indicating retriever disagreement.
Trait Implementations§
Source§impl<K: Clone> Clone for ConsensusReport<K>
impl<K: Clone> Clone for ConsensusReport<K>
Source§fn clone(&self) -> ConsensusReport<K>
fn clone(&self) -> ConsensusReport<K>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K: Debug> Debug for ConsensusReport<K>
impl<K: Debug> Debug for ConsensusReport<K>
Source§impl<'de, K> Deserialize<'de> for ConsensusReport<K>where
K: Deserialize<'de>,
impl<'de, K> Deserialize<'de> for ConsensusReport<K>where
K: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<K: PartialEq> PartialEq for ConsensusReport<K>
impl<K: PartialEq> PartialEq for ConsensusReport<K>
Source§impl<K> Serialize for ConsensusReport<K>where
K: Serialize,
impl<K> Serialize for ConsensusReport<K>where
K: Serialize,
impl<K> StructuralPartialEq for ConsensusReport<K>
Auto Trait Implementations§
impl<K> Freeze for ConsensusReport<K>
impl<K> RefUnwindSafe for ConsensusReport<K>where
K: RefUnwindSafe,
impl<K> Send for ConsensusReport<K>where
K: Send,
impl<K> Sync for ConsensusReport<K>where
K: Sync,
impl<K> Unpin for ConsensusReport<K>where
K: Unpin,
impl<K> UnsafeUnpin for ConsensusReport<K>
impl<K> UnwindSafe for ConsensusReport<K>where
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more