Skip to content

lazymatrix::RowStats ​

LazyMatrix for Rust · 0.9.0

Source

rust
pub trait RowStats<F: Scalar>: MatrixShape + MatrixErrorType

Row statistics used to fit independently normalized samples.

Implementations sum duplicate cells before nonlinear statistics and include implicit zeros. Present vectors have length nrows; inactive components are None. Raw zero scales remain zero here. Fitting replaces them with one.

Methods ​

dense_row_normalization_stats ​

rust
fn dense_row_normalization_stats(
    &self,
    spec: RowNormalization
) -> RowNormalizationStats<F> where Self: MatrixRead<F> + Sized

Source

Compute raw row statistics from dense indexed storage.

Dense adapters can delegate their fitting hook to this implementation. It uses O(nrows + ncols) storage, including one working row for quantiles.

row_normalization_stats ​

rust
fn row_normalization_stats(
    &self,
    spec: RowNormalization
) -> Result<RowNormalizationStats<F>, <Self as MatrixErrorType>::Error>

Source

Compute the centers and raw scales requested by spec.

Backends can share scans through this hook. Returns the first storage error encountered while computing the statistics.

Implementation of RowStats ​

Source

rust
impl<M: lazymatrix::RowStats<F>, F: Scalar> RowStats<F> for SprsCsc<M>

Implementation of RowStats ​

Source

rust
impl<M: lazymatrix::RowStats<F>, F: Scalar> RowStats<F> for SprsCsr<M>

Released under the MIT and Apache 2.0 licenses.