sklearn.utils.extmath.safe_sparse_dot
-
sklearn.utils.extmath.safe_sparse_dot(a, b, *, dense_output=False)[source] -
Dot product that handle the sparse matrix case correctly.
- Parameters
-
-
a{ndarray, sparse matrix} -
b{ndarray, sparse matrix} -
dense_outputbool, default=False -
When False,
aandbboth being sparse will yield sparse output. When True, output will always be a dense array.
-
- Returns
-
-
dot_product{ndarray, sparse matrix} -
Sparse if
aandbare sparse anddense_output=False.
-
© 2007–2020 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/0.24/modules/generated/sklearn.utils.extmath.safe_sparse_dot.html