Skip to content

DOC: add link to the plot_mahalanobis_distances example#31485

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

DOC: add link to the plot_mahalanobis_distances example#31485
adrinjalali merged 5 commits intoscikit-learn:mainfrom
natmokval:doc-add-link-plot_mahalanobis_distances-examples

Conversation

@natmokval
Copy link
Copy Markdown
Contributor

@natmokval natmokval commented Jun 5, 2025

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
Copy link
Copy Markdown

github-actions bot commented Jun 5, 2025

✔️ Linting Passed

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

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

@natmokval
Copy link
Copy Markdown
Contributor Author

natmokval commented Jun 9, 2025

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

Copy link
Copy Markdown
Member

@virchan virchan left a comment

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.

Copy link
Copy Markdown
Member

@virchan virchan left a comment

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.

Copy link
Copy Markdown
Contributor Author

@natmokval natmokval Jun 13, 2025

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.

Copy link
Copy Markdown
Member

@virchan virchan left a comment

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?

Copy link
Copy Markdown
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM.

Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
@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
36 checks passed
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
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