util
to_csr_matrix(X, binary=False) ¶
Convert a matrix-like object to a scipy csr_matrix.
:param X: Matrix-like object or tuple of objects to convert. :type X: csr_matrix :param binary: If true, ensure matrix is binary by setting non-zero values to 1. :type binary: bool, optional :return: Matrices as csr_matrix. :rtype: Union[csr_matrix, Tuple[csr_matrix, ...]]
Source code in src/recnexteval/matrix/util.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |