From 457b02c61a2f3cd353d2997929b67a3ef890bf60 Mon Sep 17 00:00:00 2001 From: Yao Xiao <108576690+Charlie-XIAO@users.noreply.github.com> Date: Tue, 26 Sep 2023 23:07:01 +0800 Subject: [PATCH] DOC fix return type of `make_sparse_spd_matrix` (#27472) --- sklearn/datasets/_samples_generator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 --------