Skip to main content

QueryPoolVectorScoreOperator

Struct QueryPoolVectorScoreOperator 

Source
pub struct QueryPoolVectorScoreOperator {
    pub query_vector: Vec<f32>,
    pub k: usize,
    pub field: String,
    pub base_rate: f64,
    pub split: RelevantSampleSplit,
}
Expand description

Query-pool vector score transform.

Fits the likelihood-ratio calibration from the retrieved pool at query time: the head of the sorted distance distribution (per RelevantSampleSplit) estimates the relevant density f_R, the tail estimates the background density f_G, and each candidate’s posterior is sigmoid(log(f_R(d) / f_G(d)) + logit(base_rate)) via VectorProbabilityTransform. An uninformative pool (too small, zero spread, or no head/tail separation) yields the prior for every candidate instead of fabricating discrimination. Because the same selected pool supplies both pseudo-classes, this is an unsupervised ranking transform, not a reusable calibrated-probability model. Use uqa_scoring::VectorCalibrationModel for the latter contract.

Fields§

§query_vector: Vec<f32>§k: usize§field: String§base_rate: f64

Relevance prior folded into the posterior. The default 0.5 contributes zero log-odds, so the output doubles as prior-free evidence for fusion-level priors.

§split: RelevantSampleSplit

Implementations§

Source§

impl QueryPoolVectorScoreOperator

Source

pub fn new(query_vector: Vec<f32>, k: usize, field: impl Into<String>) -> Self

Source

pub fn with_split(self, split: RelevantSampleSplit) -> Self

Source

pub fn with_base_rate(self, base_rate: f64) -> Self

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.