pub struct Streaming {
n: u64,
mean: f64,
m2: f64,
min: f64,
max: f64,
}Expand description
Streaming mean/variance via Welford’s online algorithm (O(1) memory).
Fields§
§n: u64§mean: f64§m2: f64§min: f64§max: f64Implementations§
Source§impl Streaming
impl Streaming
pub fn new() -> Self
pub fn push(&mut self, x: f64)
pub fn push_all(&mut self, values: impl IntoIterator<Item = f64>)
pub fn merge(&mut self, other: &Streaming)
pub fn count(&self) -> u64
pub fn mean(&self) -> f64
pub fn variance_pop(&self) -> f64
pub fn std_dev(&self) -> f64
pub fn std_dev_pop(&self) -> f64
pub fn min(&self) -> f64
pub fn max(&self) -> f64
Trait Implementations§
Source§impl Extend<f64> for Streaming
impl Extend<f64> for Streaming
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = f64>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = f64>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl Freeze for Streaming
impl RefUnwindSafe for Streaming
impl Send for Streaming
impl Sync for Streaming
impl Unpin for Streaming
impl UnsafeUnpin for Streaming
impl UnwindSafe for Streaming
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