lenskit.math.sparse
Sparse matrix utility functions.
Functions
-
lenskit.math.sparse.normalize_sparse_rows(matrix: Tensor, method: Literal['center'], inplace: bool = False) → tuple[Tensor, Tensor]
-
lenskit.math.sparse.normalize_sparse_rows(matrix: Tensor, method: Literal['unit'], inplace: bool = False) → tuple[Tensor, Tensor]
Normalize the rows of a sparse matrix.
-
lenskit.math.sparse.torch_sparse_from_scipy(M, layout='coo')
Convert a SciPy sps.coo_array
into a torch sparse tensor.
- Parameters:
-
- Return type:
Tensor