Skip to content

Commit f8a3f4b

Browse files
committed
DOC fix link to examples in nearest neighbors doc
1 parent 78c06e5 commit f8a3f4b

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

doc/modules/neighbors.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,15 @@ implementation with special data types. The precomputed neighbors
587587

588588
.. topic:: Examples:
589589

590-
* :ref:`sphx_glr_auto_examples_neighbors_neighbors_in_pipeline_api.py`: an
591-
example of pipelining KNeighborsTransformer and TSNE, and of two custom
592-
nearest neighbors estimators based on external packages.
590+
* :ref:`sphx_glr_auto_examples_neighbors_approximate_nearest_neighbors.py`:
591+
an example of pipelining :class:`KNeighborsTransformer` and
592+
:class:`~sklearn.manifold.TSNE`. Also proposes two custom nearest neighbors
593+
estimators based on external packages.
594+
595+
* :ref:`sphx_glr_auto_examples_neighbors_plot_caching_nearest_neighbors.py`:
596+
an example of pipelining :class:`KNeighborsTransformer` and
597+
:class:`KNeighborsClassifier` to enable caching of the neighbors graph
598+
during a hyper-parameter grid-search.
593599

594600
.. _nca:
595601

examples/neighbors/approximate_nearest_neighbors.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,23 @@
44
=====================================
55
66
This example presents how to chain KNeighborsTransformer and TSNE in a
7-
pipeline, and how to wrap the packages `annoy` and `nmslib` to replace
8-
KNeighborsTransformer and perform approximate nearest neighbors.
9-
These package can be installed with `pip install annoy nmslib`.
7+
pipeline. It also shows how to wrap the packages `annoy` and `nmslib` to
8+
replace KNeighborsTransformer and perform approximate nearest neighbors.
9+
These packages can be installed with `pip install annoy nmslib`.
1010
11-
Note: Currently TSNE(metric='precomputed') does not modify the precomputed
11+
Note: Currently `TSNE(metric='precomputed')` does not modify the precomputed
1212
distances, and thus assumes that precomputed euclidean distances are squared.
1313
In future versions, a parameter in TSNE will control the optional squaring of
1414
precomputed distances (see #12401).
1515
16-
Note: In :class:`KNeighborsTransformer` we use the definition which includes
17-
each training point as its own neighbor in the count of `n_neighbors`, and for
16+
Note: In KNeighborsTransformer we use the definition which includes each
17+
training point as its own neighbor in the count of `n_neighbors`, and for
1818
compatibility reasons, one extra neighbor is computed when
1919
`mode == 'distance'`. Please note that we do the same in the proposed wrappers.
2020
2121
Sample output:
2222
23+
```
2324
Benchmarking on MNIST_2000:
2425
---------------------------
2526
AnnoyTransformer: 0.583 sec
@@ -39,6 +40,7 @@
3940
TSNE with NMSlibTransformer: 43.295 sec
4041
TSNE with KNeighborsTransformer: 64.845 sec
4142
TSNE with internal NearestNeighbors: 64.984 sec
43+
```
4244
"""
4345
# Author: Tom Dupre la Tour
4446
#

0 commit comments

Comments
 (0)