<p dir="auto">I just found this out : if you go on this function's documentation:</p>
<p dir="auto"><a href="https://scikit-learn.org/stable/modules/generated/sklearn.metrics.explained_variance_score.html" rel="nofollow">https://scikit-learn.org/stable/modules/generated/sklearn.metrics.explained_variance_score.html</a></p>
<p dir="auto">and click on "source" (top right)</p>
<p dir="auto">you do not end up on the right source code page...</p>
<p dir="auto">I guess this is a sphinx-related issue ?</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/16453674/81950467-4206d100-9604-11ea-8fa1-cb1ef0fc6207.png"><img src="https://user-images.githubusercontent.com/16453674/81950467-4206d100-9604-11ea-8fa1-cb1ef0fc6207.png" alt="image" style="max-width: 100%;"></a></p>
<h4 dir="auto">Describe the issue linked to the documentation</h4>
<p dir="auto">The [source] code link on <code class="notranslate">sklearn.metrics.f1_score</code> documentation page points to a <a href="https://github.com/scikit-learn/scikit-learn/blob/483cd3eaa/sklearn/utils/validation.py#L925">random line in utils/validation.py</a> instead of pointing to the <a href="https://github.com/scikit-learn/scikit-learn/blob/483cd3eaa/sklearn/metrics/_classification.py#L926">defintion of f1_score in metrics/_classification.py</a>. See image and try it on the <a href="https://scikit-learn.org/stable/modules/generated/sklearn.metrics.f1_score.html#sklearn.metrics.f1_score" rel="nofollow">f1_score doc page</a>.</p>
<h4 dir="auto">Suggest a potential alternative/fix</h4>
<p dir="auto">Replace <a href="https://github.com/scikit-learn/scikit-learn/blob/483cd3eaa/sklearn/utils/validation.py#L925">link to random line in utils/validation.py</a> with <a href="https://github.com/scikit-learn/scikit-learn/blob/483cd3eaa/sklearn/metrics/_classification.py#L926">link to defintion of f1_score in metrics/_classification.py</a> on <a href="https://scikit-learn.org/stable/modules/generated/sklearn.metrics.f1_score.html#sklearn.metrics.f1_score" rel="nofollow">f1_score doc page</a>.</p>
<p dir="auto">I fixed it in the generated html and made a <a href="https://github.com/scikit-learn/scikit-learn.github.io/pull/15/commits/a9c6c69960b05282fccd2560732b268f5df4c356">PR</a> <g-emoji class="g-emoji" alias="facepalm" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f926.png">🤦</g-emoji></p>