Description
When running a the test suite we get a number PendingDeprecationWarning
,
PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
return matrix(data, dtype=dtype, copy=False)
See for instance https://ci.appveyor.com/project/sklearn-ci/scikit-learn/builds/19341228/job/q6rysq7flma8hi6v Warnings seems to be hidden on Travis so we don't see those there.
This typically happens when we have a sparse matrix, sum along one axis to get a dense one, than do some mathematical operation with this matrix. It should be explicitly converted to an array first.
This has also been reported by @drorata in #11251 (comment). There was previous discussion about this in #11251 but it doesn't look like it's fixed. I also saw this recently when running PyPy CI.
To investigate where this happen it's sufficient to run pytest tests with -Werror::PendingDeprecationWarning
to error on those warnings, as they don't seem to be raised with the right stacklevel (see also #7963 (comment) for workarounds)