spamosaic.preprocessing.sparse_log1p_scale

spamosaic.preprocessing.sparse_log1p_scale(X, scale=10000.0)[source]

Apply log1p transformation to sparse or dense matrix, scaled by a factor.

Parameters:
  • X (Union[scipy.sparse.spmatrix, np.ndarray]) – Input expression matrix.

  • scale (float, default=1e4) – Scaling factor applied before log1p.

Return type:

Transformed matrix (same type as input)