pub struct QueryByCommittee { /* private fields */ }Expand description
Query by Committee for Active Learning
Query by Committee selects samples where multiple models disagree the most. It maintains an ensemble of models and selects samples with the highest disagreement among committee members.
§Parameters
n_committee_members- Number of models in the committeedisagreement_measure- Measure of disagreement (“vote_entropy”, “kl_divergence”)n_samples- Number of samples to selectdiversity_weight- Weight for diversity in selection
§Examples
ⓘ
use sklears_semi_supervised::QueryByCommittee;
let committee_probas = vec![
array![[0.8, 0.2], [0.6, 0.4], [0.3, 0.7]],
array![[0.7, 0.3], [0.5, 0.5], [0.4, 0.6]],
array![[0.9, 0.1], [0.4, 0.6], [0.2, 0.8]],
];
let qbc = QueryByCommittee::new()
.n_committee_members(3)
.disagreement_measure("vote_entropy".to_string())
.n_samples(2);
let selected = qbc.select_samples(&committee_probas).unwrap();Implementations§
Source§impl QueryByCommittee
impl QueryByCommittee
Sourcepub fn n_committee_members(self, n_members: usize) -> Self
pub fn n_committee_members(self, n_members: usize) -> Self
Set the number of committee members
Sourcepub fn disagreement_measure(self, measure: String) -> Self
pub fn disagreement_measure(self, measure: String) -> Self
Set the disagreement measure
Sourcepub fn diversity_weight(self, weight: f64) -> Self
pub fn diversity_weight(self, weight: f64) -> Self
Set the diversity weight
Sourcepub fn normalize_disagreement(self, normalize: bool) -> Self
pub fn normalize_disagreement(self, normalize: bool) -> Self
Enable/disable disagreement normalization
Trait Implementations§
Source§impl Clone for QueryByCommittee
impl Clone for QueryByCommittee
Source§fn clone(&self) -> QueryByCommittee
fn clone(&self) -> QueryByCommittee
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 moreSource§impl Debug for QueryByCommittee
impl Debug for QueryByCommittee
Auto Trait Implementations§
impl Freeze for QueryByCommittee
impl RefUnwindSafe for QueryByCommittee
impl Send for QueryByCommittee
impl Sync for QueryByCommittee
impl Unpin for QueryByCommittee
impl UnwindSafe for QueryByCommittee
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