Skip to content

DOC: add link to the plot_mahalanobis_distances example - #31485

Merged
adrinjalali merged 5 commits into
scikit-learn:mainfrom
natmokval:doc-add-link-plot_mahalanobis_distances-examples
Jun 18, 2025
Merged

adrinjalali merged 5 commits into
scikit-learn:mainfrom
natmokval:doc-add-link-plot_mahalanobis_distances-examples

Conversation

@natmokval

@natmokval natmokval commented Jun 5, 2025 •

Copy link
Copy Markdown
Contributor

Towards #30621

This PR adds a reference to the plot_mahalanobis_distances.py.

The plot_mahalanobis_distances.py example is already referenced in the User Guide. I added a link to make the example visible from the API documentation as well.

@github-actions

github-actions Bot commented Jun 5, 2025 •

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 9e8b9fb. Link to the linter CI: here

@natmokval

natmokval commented Jun 9, 2025 •

Copy link
Copy Markdown
Contributor Author

@StefanieSenger, I added link to the plot_mahalanobis_distances example. Could you please take a look at this PR?

@virchan virchan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, @natmokval! I have a few comments.

Comment on lines +140 to +142
For an example of using covariance estimation with Mahalanobis
distances on Gaussian distributed data, refer to
:ref:`sphx_glr_auto_examples_covariance_plot_mahalanobis_distances.py`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be better idea to place this inside the mahalanobis method's docstring. Also,

"For a detailed example of how outlying data affects the Mahalanobis distance, see <example_link>."

The same applies to MinCovDet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @virchan for reviewing my PR! I moved the link to the plot_mahalanobis_distances example into the mahalanobis method’s docstring, as you suggested. I don’t think a reference is needed in MinCovDet anymore after that.

@virchan virchan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for updating the PR, @natmokval! I have a few more comments.

Comment on lines +357 to +361

Notes
-----
For a detailed example of how outlying data affects the Mahalanobis distance,
see :ref:`sphx_glr_auto_examples_covariance_plot_mahalanobis_distances.py`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please place this before the "Parameters" section? Also, I think we don't need "Notes" here.

@natmokval natmokval Jun 13, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @virchan, I placed the link before the Parameters section and removed Notes section.

@virchan virchan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @natmokval!

@adrinjalali, @marenwestermann, would you like to have a look and merge this?

@adrinjalali adrinjalali left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM.

@natmokval

Copy link
Copy Markdown
Contributor Author

@adrinjalali, thanks for reviewing this PR.

@adrinjalali
adrinjalali merged commit 64537e0 into scikit-learn:main Jun 18, 2025
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 15, 2025
@jeremiedbb jeremiedbb mentioned this pull request Jul 15, 2025
13 tasks done
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants