sklearn.datasets.make_spd_matrix

sklearn.datasets.make_spd_matrix(n_dim, *, random_state=None) [source]

Generate a random symmetric, positive-definite matrix.

Read more in the User Guide.

Parameters
n_dimint

The matrix dimension.

random_stateint, RandomState instance or None, default=None

Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls. See Glossary.

Returns
Xndarray of shape (n_dim, n_dim)

The random symmetric, positive-definite matrix.

© 2007–2020 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/0.24/modules/generated/sklearn.datasets.make_spd_matrix.html