pub struct ParameterLearner { /* private fields */ }Implementations§
Source§impl ParameterLearner
impl ParameterLearner
pub fn new(alpha: f64, beta: f64, base_rate: Option<f64>) -> ScoringResult<Self>
pub fn alpha(&self) -> f64
pub fn beta(&self) -> f64
pub fn base_rate(&self) -> Option<f64>
pub fn params(&self) -> BTreeMap<String, f64>
pub fn probability(&self, raw_score: f64) -> ScoringResult<f64>
Sourcepub fn update(
&mut self,
raw_score: f64,
label: f64,
learning_rate: f64,
) -> ScoringResult<()>
pub fn update( &mut self, raw_score: f64, label: f64, learning_rate: f64, ) -> ScoringResult<()>
Apply one exact logistic-loss gradient step to a raw BM25 score.
pub fn fit( &mut self, raw_scores: &[f64], labels: &[f64], learning_rate: f64, epochs: usize, ) -> ScoringResult<BTreeMap<String, f64>>
pub fn fit_with_options( &mut self, raw_scores: &[f64], labels: &[f64], ) -> ScoringResult<BTreeMap<String, f64>>
Trait Implementations§
Source§impl Clone for ParameterLearner
impl Clone for ParameterLearner
Source§fn clone(&self) -> ParameterLearner
fn clone(&self) -> ParameterLearner
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 moreSource§impl Debug for ParameterLearner
impl Debug for ParameterLearner
Auto Trait Implementations§
impl Freeze for ParameterLearner
impl RefUnwindSafe for ParameterLearner
impl Send for ParameterLearner
impl Sync for ParameterLearner
impl Unpin for ParameterLearner
impl UnsafeUnpin for ParameterLearner
impl UnwindSafe for ParameterLearner
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