pub struct SyntheticUser {
pub theta: Vec<f64>,
pub tau: f64,
pub cuts: Vec<f64>,
}Expand description
A simulated user with fixed ground-truth taste.
Fields§
§theta: Vec<f64>Ground-truth weight vector.
tau: f64Ground-truth keep/kill threshold.
cuts: Vec<f64>Ground-truth ordered star cutpoints.
Implementations§
Source§impl SyntheticUser
impl SyntheticUser
Sourcepub fn duel<R: Rng>(&self, rng: &mut R, a: &[f64], b: &[f64]) -> bool
pub fn duel<R: Rng>(&self, rng: &mut R, a: &[f64], b: &[f64]) -> bool
Sample a duel outcome (true = chose A), Bradley–Terry noise.
Sourcepub fn stars<R: Rng>(&self, rng: &mut R, x: &[f64]) -> u8
pub fn stars<R: Rng>(&self, rng: &mut R, x: &[f64]) -> u8
Sample a star rating (cumulative-logit ordinal).
Sourcepub fn observe_duel<R: Rng>(
&self,
rng: &mut R,
a: Vec<f64>,
b: Vec<f64>,
session: usize,
) -> Observation
pub fn observe_duel<R: Rng>( &self, rng: &mut R, a: Vec<f64>, b: Vec<f64>, session: usize, ) -> Observation
Generate a full duel observation on the given pair.
Trait Implementations§
Source§impl Clone for SyntheticUser
impl Clone for SyntheticUser
Source§fn clone(&self) -> SyntheticUser
fn clone(&self) -> SyntheticUser
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 moreAuto Trait Implementations§
impl Freeze for SyntheticUser
impl RefUnwindSafe for SyntheticUser
impl Send for SyntheticUser
impl Sync for SyntheticUser
impl Unpin for SyntheticUser
impl UnsafeUnpin for SyntheticUser
impl UnwindSafe for SyntheticUser
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