pub struct OnlineStats {
pub n_updates: usize,
pub n_mistakes: usize,
pub cumulative_loss: f64,
pub mean_loss: f64,
pub last_weight_norm: f64,
}Expand description
Cumulative statistics for an online learning session.
Fields§
§n_updates: usizeTotal number of update calls.
n_mistakes: usizeTotal number of incorrect predictions (classification only).
cumulative_loss: f64Sum of per-sample losses.
mean_loss: f64Running mean loss: cumulative_loss / n_updates.
last_weight_norm: f64||w|| after the most recent update.
Implementations§
Source§impl OnlineStats
impl OnlineStats
Sourcepub fn mistake_rate(&self) -> f64
pub fn mistake_rate(&self) -> f64
Fraction of updates that resulted in a mistake (classification).
Returns 0.0 when no updates have been performed.
Sourcepub fn update(&mut self, result: &OnlineUpdateResult)
pub fn update(&mut self, result: &OnlineUpdateResult)
Incorporate the result of one update step into running statistics.
Trait Implementations§
Source§impl Clone for OnlineStats
impl Clone for OnlineStats
Source§fn clone(&self) -> OnlineStats
fn clone(&self) -> OnlineStats
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 OnlineStats
impl Debug for OnlineStats
Source§impl Default for OnlineStats
impl Default for OnlineStats
Source§fn default() -> OnlineStats
fn default() -> OnlineStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OnlineStats
impl RefUnwindSafe for OnlineStats
impl Send for OnlineStats
impl Sync for OnlineStats
impl Unpin for OnlineStats
impl UnsafeUnpin for OnlineStats
impl UnwindSafe for OnlineStats
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