pub struct BanditBasedActiveLearning {
pub strategy_names: Vec<String>,
pub bandit_algorithm: String,
pub reward_function: String,
pub random_state: Option<u64>,
/* private fields */
}Expand description
Bandit-based Active Learning coordinator
This coordinates multiple query strategies using bandit algorithms, treating each strategy as an arm and adaptively selecting strategies based on their performance.
Fields§
§strategy_names: Vec<String>strategy_names
bandit_algorithm: Stringbandit_algorithm
reward_function: Stringreward_function
random_state: Option<u64>random_state
Implementations§
Source§impl BanditBasedActiveLearning
impl BanditBasedActiveLearning
pub fn new(strategy_names: Vec<String>, bandit_algorithm: String) -> Self
pub fn reward_function(self, reward_function: String) -> Self
pub fn random_state(self, random_state: u64) -> Self
pub fn initialize( &mut self, epsilon: Option<f64>, confidence: Option<f64>, exploration: Option<f64>, ) -> Result<()>
pub fn select_strategy( &mut self, context: Option<&ArrayView1<'_, f64>>, ) -> Result<usize>
pub fn update_strategy( &mut self, strategy_idx: usize, reward: f64, context: Option<&ArrayView1<'_, f64>>, ) -> Result<()>
pub fn get_strategy_performance(&self) -> Result<HashMap<String, f64>>
Trait Implementations§
Source§impl Clone for BanditBasedActiveLearning
impl Clone for BanditBasedActiveLearning
Source§fn clone(&self) -> BanditBasedActiveLearning
fn clone(&self) -> BanditBasedActiveLearning
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 BanditBasedActiveLearning
impl RefUnwindSafe for BanditBasedActiveLearning
impl Send for BanditBasedActiveLearning
impl Sync for BanditBasedActiveLearning
impl Unpin for BanditBasedActiveLearning
impl UnwindSafe for BanditBasedActiveLearning
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