pub struct ModelInstance<Event, PosteriorEvent>{ /* private fields */ }Expand description
Instance of a model for given data and event universe. From the instance, posterior, marginal and MAP can be computed.
Implementations§
Source§impl<Event, PosteriorEvent> ModelInstance<Event, PosteriorEvent>
impl<Event, PosteriorEvent> ModelInstance<Event, PosteriorEvent>
Sourcepub fn posterior(&self, event: &PosteriorEvent) -> Option<LogProb>
pub fn posterior(&self, event: &PosteriorEvent) -> Option<LogProb>
Posterior probability of given event.
Sourcepub fn maximum_posterior(&self) -> Option<&Event>
pub fn maximum_posterior(&self) -> Option<&Event>
Maximum a posteriori estimate.
Sourcepub fn event_posteriors(&self) -> impl Iterator<Item = (&Event, LogProb)>
pub fn event_posteriors(&self) -> impl Iterator<Item = (&Event, LogProb)>
Event posteriors sorted in descending order.
Trait Implementations§
Source§impl<Event, PosteriorEvent> Clone for ModelInstance<Event, PosteriorEvent>
impl<Event, PosteriorEvent> Clone for ModelInstance<Event, PosteriorEvent>
Source§fn clone(&self) -> ModelInstance<Event, PosteriorEvent>
fn clone(&self) -> ModelInstance<Event, PosteriorEvent>
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<Event, PosteriorEvent> Debug for ModelInstance<Event, PosteriorEvent>
impl<Event, PosteriorEvent> Debug for ModelInstance<Event, PosteriorEvent>
Source§impl<Event, PosteriorEvent> Default for ModelInstance<Event, PosteriorEvent>
impl<Event, PosteriorEvent> Default for ModelInstance<Event, PosteriorEvent>
Source§fn default() -> ModelInstance<Event, PosteriorEvent>
fn default() -> ModelInstance<Event, PosteriorEvent>
Returns the “default value” for a type. Read more
Source§impl<'de, Event, PosteriorEvent> Deserialize<'de> for ModelInstance<Event, PosteriorEvent>
impl<'de, Event, PosteriorEvent> Deserialize<'de> for ModelInstance<Event, PosteriorEvent>
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<Event, PosteriorEvent> PartialEq for ModelInstance<Event, PosteriorEvent>
impl<Event, PosteriorEvent> PartialEq for ModelInstance<Event, PosteriorEvent>
Source§fn eq(&self, other: &ModelInstance<Event, PosteriorEvent>) -> bool
fn eq(&self, other: &ModelInstance<Event, PosteriorEvent>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<Event, PosteriorEvent> Serialize for ModelInstance<Event, PosteriorEvent>
impl<Event, PosteriorEvent> Serialize for ModelInstance<Event, PosteriorEvent>
impl<Event, PosteriorEvent> StructuralPartialEq for ModelInstance<Event, PosteriorEvent>
Auto Trait Implementations§
impl<Event, PosteriorEvent> Freeze for ModelInstance<Event, PosteriorEvent>
impl<Event, PosteriorEvent> RefUnwindSafe for ModelInstance<Event, PosteriorEvent>where
Event: RefUnwindSafe,
PosteriorEvent: RefUnwindSafe,
impl<Event, PosteriorEvent> Send for ModelInstance<Event, PosteriorEvent>
impl<Event, PosteriorEvent> Sync for ModelInstance<Event, PosteriorEvent>
impl<Event, PosteriorEvent> Unpin for ModelInstance<Event, PosteriorEvent>
impl<Event, PosteriorEvent> UnwindSafe for ModelInstance<Event, PosteriorEvent>where
Event: UnwindSafe,
PosteriorEvent: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.