pub struct HubnessScore {
pub item_id: String,
pub neighbor_hits: usize,
pub normalized_score: f32,
}Expand description
Deterministic CPU-only hubness scoring over a set of dense embeddings.
Hubness is the tendency of a small number of vectors to appear in the k-nearest-neighbour lists of many other vectors in high-dimensional spaces. This module computes a lightweight hub score for each item given a flat slice of (id, embedding) pairs. Per-item hubness score.
Fields§
§item_id: String§neighbor_hits: usizeHow many times this item appeared in another item’s top-k neighbour list.
normalized_score: f32neighbor_hits / max_possible_hits where max_possible_hits = n - 1.
Zero when there are fewer than two items.
Trait Implementations§
Source§impl Clone for HubnessScore
impl Clone for HubnessScore
Source§fn clone(&self) -> HubnessScore
fn clone(&self) -> HubnessScore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HubnessScore
impl Debug for HubnessScore
Source§impl PartialEq for HubnessScore
impl PartialEq for HubnessScore
impl StructuralPartialEq for HubnessScore
Auto Trait Implementations§
impl Freeze for HubnessScore
impl RefUnwindSafe for HubnessScore
impl Send for HubnessScore
impl Sync for HubnessScore
impl Unpin for HubnessScore
impl UnsafeUnpin for HubnessScore
impl UnwindSafe for HubnessScore
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