skfolio.utils.stats.assert_is_symmetric#

skfolio.utils.stats.assert_is_symmetric(x, *, rtol=1e-05, atol=1e-08)[source]#

Raises an error if the matrix is not symmetric.

Parameters:
xndarray of shape (n, m)

The matrix.

rtolfloat, default=1e-5

Relative tolerance for numpy.allclose.

atolfloat, default=1e-8

Absolute tolerance for numpy.allclose.

Raises:
ValueError: if the matrix is not symmetric.