diff --git a/sklearn/datasets/_samples_generator.py b/sklearn/datasets/_samples_generator.py index 1fbb0af300bae..181bf9a997921 100644 --- a/sklearn/datasets/_samples_generator.py +++ b/sklearn/datasets/_samples_generator.py @@ -1627,8 +1627,9 @@ def make_sparse_spd_matrix( Returns ------- - prec : sparse matrix of shape (dim, dim) - The generated matrix. + prec : ndarray or sparse matrix of shape (dim, dim) + The generated matrix. If ``sparse_format=None``, this would be an ndarray. + Otherwise, this will be a sparse matrix of the specified format. See Also --------