<h4 dir="auto">Description</h4>
<p dir="auto">Using <code class="notranslate">adjusted_rand_score</code> gives me a PendingDeprecationWarning as seen below:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/lib/python3.6/site-packages/numpy/matrixlib/defmatrix.py:68: 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."><pre class="notranslate"><code class="notranslate">/lib/python3.6/site-packages/numpy/matrixlib/defmatrix.py:68: 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.
</code></pre></div>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<p dir="auto">Example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sklearn.metrics import adjusted_rand_score
from sklearn.datasets import make_blobs

X, y = make_blobs()
kmeans = KMeans()
pred = kmeans.fit_predict(X)
adjusted_rand_score(y, pred)"><pre lang="from" class="notranslate"><code class="notranslate">from sklearn.metrics import adjusted_rand_score
from sklearn.datasets import make_blobs

X, y = make_blobs()
kmeans = KMeans()
pred = kmeans.fit_predict(X)
adjusted_rand_score(y, pred)
</code></pre></div>
<h4 dir="auto">Versions</h4>
<h2 dir="auto">System</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="python: 3.6.5 (default, Jun 17 2018, 12:26:58)  [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]"><pre class="notranslate"><code class="notranslate">python: 3.6.5 (default, Jun 17 2018, 12:26:58)  [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
</code></pre></div>
<p dir="auto">executable: /usr/local/Cellar/python/3.6.5_1/bin/python3.6<br>
machine: Darwin-16.7.0-x86_64-i386-64bit</p>
<h2 dir="auto">BLAS</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="macros: NO_ATLAS_INFO=3, HAVE_CBLAS=None"><pre class="notranslate"><code class="notranslate">macros: NO_ATLAS_INFO=3, HAVE_CBLAS=None
</code></pre></div>
<p dir="auto">lib_dirs:<br>
cblas_libs: cblas</p>
<h2 dir="auto">Python deps</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   pip: 18.1"><pre class="notranslate"><code class="notranslate">   pip: 18.1
</code></pre></div>
<p dir="auto">setuptools: 40.4.3<br>
sklearn: 0.20.0<br>
numpy: 1.15.3<br>
scipy: 1.1.0<br>
Cython: None<br>
pandas: 0.23.4</p>
<p dir="auto">When running a the test suite we get a number <code class="notranslate">PendingDeprecationWarning</code>,</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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)"><pre class="notranslate"><code class="notranslate">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)
</code></pre></div>
<p dir="auto">See for instance <a href="https://ci.appveyor.com/project/sklearn-ci/scikit-learn/builds/19341228/job/q6rysq7flma8hi6v" rel="nofollow">https://ci.appveyor.com/project/sklearn-ci/scikit-learn/builds/19341228/job/q6rysq7flma8hi6v</a>  Warnings seems to be hidden on Travis so we don't see those there.</p>
<p dir="auto">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.</p>
<p dir="auto">This has also been reported by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/drorata/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/drorata">@drorata</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="331924701" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/11251" data-hovercard-type="pull_request" data-hovercard-url="/scikit-learn/scikit-learn/pull/11251/hovercard?comment_id=427865173&amp;comment_type=issue_comment" href="https://github.com/scikit-learn/scikit-learn/pull/11251#issuecomment-427865173">#11251 (comment)</a>. There was previous discussion about this in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="331924701" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/11251" data-hovercard-type="pull_request" data-hovercard-url="/scikit-learn/scikit-learn/pull/11251/hovercard" href="https://github.com/scikit-learn/scikit-learn/pull/11251">#11251</a> but it doesn't look like it's fixed.  I also saw this recently when running PyPy CI.</p>
<p dir="auto">To investigate where this happen it's sufficient to run pytest tests with <code class="notranslate">-Werror::PendingDeprecationWarning</code> to error on those warnings, as they don't seem to be raised with the right stacklevel (see also <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="193111938" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/7963" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/7963/hovercard?comment_id=265420200&amp;comment_type=issue_comment" href="https://github.com/scikit-learn/scikit-learn/issues/7963#issuecomment-265420200">#7963 (comment)</a> for workarounds)</p>