pub struct Evidence { /* private fields */ }Expand description
The accumulated evidence for one relationship: the pseudo-counts of its Beta posterior.
alpha counts corroboration, beta counts contradiction. Both are
weighted sums, not integers — an observation contributes its provenance
weight. Counts are non-negative by construction.
Implementations§
Source§impl Evidence
impl Evidence
Sourcepub fn from_prior(mean: f64) -> Self
pub fn from_prior(mean: f64) -> Self
Evidence for an edge that has only a mean: split PRIOR_CONCENTRATION
between the two counts so the mean is preserved exactly.
This is the shape a brand-new edge starts in, and the shape the schema migration backfills legacy edges into.
Sourcepub fn from_counts(alpha: f64, beta: f64) -> Self
pub fn from_counts(alpha: f64, beta: f64) -> Self
Evidence from persisted counts. Non-finite or negative counts are clamped to zero — a corrupt count must not produce a nonsense mean.
Sourcepub fn from_stored(
alpha: Option<f64>,
beta: Option<f64>,
confidence: f64,
) -> Self
pub fn from_stored( alpha: Option<f64>, beta: Option<f64>, confidence: f64, ) -> Self
Evidence for an edge as read from the store.
Uses the persisted counts when present; falls back to
Evidence::from_prior over the stored mean when they are absent —
the shape of an edge on a store whose migration has not run yet.
Sourcepub fn corroborate(&mut self, weight: f64)
pub fn corroborate(&mut self, weight: f64)
Record supporting evidence of the given weight.
Sourcepub fn contradict(&mut self, weight: f64)
pub fn contradict(&mut self, weight: f64)
Record contradicting evidence of the given weight.
Sourcepub fn concentration(self) -> f64
pub fn concentration(self) -> f64
Total evidence weight behind this edge (alpha + beta).
This is what never grew in the pre-Phase-1 model: it is the difference between “believed at 0.9” and “believed at 0.9 for good reason”.
Trait Implementations§
impl Copy for Evidence
impl StructuralPartialEq for Evidence
Auto Trait Implementations§
impl Freeze for Evidence
impl RefUnwindSafe for Evidence
impl Send for Evidence
impl Sync for Evidence
impl Unpin for Evidence
impl UnsafeUnpin for Evidence
impl UnwindSafe for Evidence
Blanket Implementations§
impl<T> AsyncFriendly for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request