pub struct TasteSample {
pub theta: Vec<Vec<f64>>,
pub tau: Vec<f64>,
pub cuts: Vec<f64>,
}Expand description
One posterior draw of every latent.
Fields§
§theta: Vec<Vec<f64>>Per-style weight vectors [k][d].
tau: Vec<f64>Per-session keep/kill thresholds.
cuts: Vec<f64>Ordered star cutpoints (n_stars − 1 of them).
Implementations§
Source§impl TasteSample
impl TasteSample
Sourcepub fn utility(&self, phi: &[f64], style: usize) -> f64
pub fn utility(&self, phi: &[f64], style: usize) -> f64
Utility of a standardized candidate under one style lens.
Sourcepub fn utility_mix(&self, phi: &[f64]) -> f64
pub fn utility_mix(&self, phi: &[f64]) -> f64
Mixture utility u(φ) = max_k u_k(φ): a candidate is as good as its
best style thinks it is. Reduces to u_0 at K = 1. This is the one
utility every likelihood and ranking uses.
Sourcepub fn prob_prefers(&self, a: &[f64], b: &[f64]) -> f64
pub fn prob_prefers(&self, a: &[f64], b: &[f64]) -> f64
Probability this sample assigns to “a beats b”.
Sourcepub fn best_style(&self, phi: &[f64]) -> usize
pub fn best_style(&self, phi: &[f64]) -> usize
Which style lens is this candidate’s best (its island).
Sourcepub fn loglik(&self, feedback: &Feedback, session: usize) -> f64
pub fn loglik(&self, feedback: &Feedback, session: usize) -> f64
Log-likelihood this draw assigns to one standardized observation.
Sourcepub fn loglik_with(
&self,
feedback: &Feedback,
session: usize,
absent: &[usize],
) -> f64
pub fn loglik_with( &self, feedback: &Feedback, session: usize, absent: &[usize], ) -> f64
Self::loglik, told which coordinates of the observation were
imputed rather than measured — see FitSet::absent.
Trait Implementations§
Source§impl Clone for TasteSample
impl Clone for TasteSample
Source§fn clone(&self) -> TasteSample
fn clone(&self) -> TasteSample
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 TasteSample
impl Debug for TasteSample
Source§impl<'de> Deserialize<'de> for TasteSample
impl<'de> Deserialize<'de> for TasteSample
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 PartialEq for TasteSample
impl PartialEq for TasteSample
Source§fn eq(&self, other: &TasteSample) -> bool
fn eq(&self, other: &TasteSample) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TasteSample
impl Serialize for TasteSample
impl StructuralPartialEq for TasteSample
Auto Trait Implementations§
impl Freeze for TasteSample
impl RefUnwindSafe for TasteSample
impl Send for TasteSample
impl Sync for TasteSample
impl Unpin for TasteSample
impl UnsafeUnpin for TasteSample
impl UnwindSafe for TasteSample
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