pub struct ActiveLearningSearch<S> { /* private fields */ }Expand description
Active Learning search optimizer.
Wraps any base search strategy and adds uncertainty-based stopping. Implements the “Pull System” from Lean manufacturing - only generates samples while uncertainty is high (Settles, 2009).
§Muda Elimination (Waste Reduction)
Traditional batch generation (“Push System”) produces many redundant samples. Active Learning stops when confidence saturates, eliminating overproduction.
§Example
use aprender::automl::{ActiveLearningSearch, RandomSearch, SearchSpace, SearchStrategy};
use aprender::automl::params::RandomForestParam as RF;
let space = SearchSpace::new()
.add_continuous(RF::NEstimators, 10.0, 500.0);
let base = RandomSearch::new(1000).with_seed(42);
let mut search = ActiveLearningSearch::new(base)
.with_uncertainty_threshold(0.1) // Stop when uncertainty < 0.1
.with_min_samples(10); // Need at least 10 samples
// Pull system: generate until confident
while !search.should_stop() {
let trials = search.suggest(&space, 5);
if trials.is_empty() { break; }
// ... evaluate trials ...
// search.update(&results);
}Implementations§
Source§impl<S> ActiveLearningSearch<S>
impl<S> ActiveLearningSearch<S>
Sourcepub fn with_uncertainty_threshold(self, threshold: f64) -> Self
pub fn with_uncertainty_threshold(self, threshold: f64) -> Self
Set uncertainty threshold for stopping.
When estimated uncertainty drops below this threshold, should_stop() returns true.
Sourcepub fn with_min_samples(self, min: usize) -> Self
pub fn with_min_samples(self, min: usize) -> Self
Set minimum samples before stopping is considered.
Sourcepub fn should_stop(&self) -> bool
pub fn should_stop(&self) -> bool
Check if optimization should stop due to low uncertainty.
Returns true when:
- At least
min_sampleshave been evaluated - Uncertainty is below
uncertainty_threshold
Sourcepub fn uncertainty(&self) -> f64
pub fn uncertainty(&self) -> f64
Get current uncertainty estimate.
Uses coefficient of variation (std_dev / mean) as uncertainty metric.
Returns infinity if not enough samples.
Sourcepub fn sample_count(&self) -> usize
pub fn sample_count(&self) -> usize
Get number of samples collected.
Trait Implementations§
Source§impl<S: Clone> Clone for ActiveLearningSearch<S>
impl<S: Clone> Clone for ActiveLearningSearch<S>
Source§fn clone(&self) -> ActiveLearningSearch<S>
fn clone(&self) -> ActiveLearningSearch<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<S: Debug> Debug for ActiveLearningSearch<S>
impl<S: Debug> Debug for ActiveLearningSearch<S>
Source§impl<S, P> SearchStrategy<P> for ActiveLearningSearch<S>where
S: SearchStrategy<P>,
P: ParamKey,
impl<S, P> SearchStrategy<P> for ActiveLearningSearch<S>where
S: SearchStrategy<P>,
P: ParamKey,
Auto Trait Implementations§
impl<S> Freeze for ActiveLearningSearch<S>where
S: Freeze,
impl<S> RefUnwindSafe for ActiveLearningSearch<S>where
S: RefUnwindSafe,
impl<S> Send for ActiveLearningSearch<S>where
S: Send,
impl<S> Sync for ActiveLearningSearch<S>where
S: Sync,
impl<S> Unpin for ActiveLearningSearch<S>where
S: Unpin,
impl<S> UnwindSafe for ActiveLearningSearch<S>where
S: 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
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>
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>
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