lazymatrix::RowStats
LazyMatrix for Rust · 0.9.0
rust
pub trait RowStats<F: Scalar>: MatrixShape + MatrixErrorTypeRow 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> + SizedCompute 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>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
rust
impl<M: lazymatrix::RowStats<F>, F: Scalar> RowStats<F> for SprsCsc<M>Implementation of RowStats
rust
impl<M: lazymatrix::RowStats<F>, F: Scalar> RowStats<F> for SprsCsr<M>
