Skip to content

DOC Add missing links to Neighborhood Components Analysis #30849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/modules/neighbors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@ by each method. Each data sample belongs to one of 10 classes.

* :ref:`sphx_glr_auto_examples_neighbors_plot_nca_classification.py`
* :ref:`sphx_glr_auto_examples_neighbors_plot_nca_dim_reduction.py`
* :ref:`sphx_glr_auto_examples_neighbors_plot_nca_illustration.py`
* :ref:`sphx_glr_auto_examples_manifold_plot_lle_digits.py`

.. _nca_mathematical_formulation:
Expand Down
13 changes: 13 additions & 0 deletions sklearn/neighbors/_nca.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,19 @@ class NeighborhoodComponentsAnalysis(
KNeighborsClassifier(...)
>>> print(knn.score(nca.transform(X_test), y_test))
0.961904...

For detailed examples demonstrating the use of
:class:`~sklearn.neighbors.NeighborhoodComponentsAnalysis` in different
scenarios, please refer to:

- Illustration of how NCA transforms distances for classification:
:ref:`sphx_glr_auto_examples_neighbors_plot_nca_illustration.py`

- Comparison of NCA, PCA, and LDA for dimensionality reduction:
:ref:`sphx_glr_auto_examples_neighbors_plot_nca_dim_reduction.py`

- Comparing nearest neighbors classification with and without NCA:
:ref:`sphx_glr_auto_examples_neighbors_plot_nca_classification.py`
"""

_parameter_constraints: dict = {
Expand Down
Loading