pub struct EpsilonGreedy {
pub epsilon: f64,
pub decay_rate: f64,
pub min_epsilon: f64,
pub random_state: Option<u64>,
/* private fields */
}Expand description
Epsilon-Greedy strategy for multi-armed bandit active learning
This strategy selects the best-performing query strategy with probability (1-ε) and explores a random strategy with probability ε.
Fields§
§epsilon: f64epsilon
decay_rate: f64decay_rate
min_epsilon: f64min_epsilon
random_state: Option<u64>random_state
Implementations§
Source§impl EpsilonGreedy
impl EpsilonGreedy
pub fn new(epsilon: f64) -> Result<Self>
pub fn decay_rate(self, decay_rate: f64) -> Self
pub fn min_epsilon(self, min_epsilon: f64) -> Self
pub fn random_state(self, random_state: u64) -> Self
pub fn initialize(&mut self, n_arms: usize)
pub fn select_arm(&mut self) -> Result<usize>
pub fn update(&mut self, arm_idx: usize, reward: f64) -> Result<()>
pub fn get_arm_statistics(&self) -> Vec<(usize, f64, f64)>
Trait Implementations§
Source§impl Clone for EpsilonGreedy
impl Clone for EpsilonGreedy
Source§fn clone(&self) -> EpsilonGreedy
fn clone(&self) -> EpsilonGreedy
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 moreAuto Trait Implementations§
impl Freeze for EpsilonGreedy
impl RefUnwindSafe for EpsilonGreedy
impl Send for EpsilonGreedy
impl Sync for EpsilonGreedy
impl Unpin for EpsilonGreedy
impl UnwindSafe for EpsilonGreedy
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 more