Specifying 'cosine' as metric in KDTree throws error

### Describe the bug

I am trying to implement the `KDTree Algorithm` with `cosine` as a distance metric. I first started with [scipy's implementation](https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.KDTree.html), but it didn't support `cosine` as a metric. Then, I came across [sklearn implementation](https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KDTree.html#sklearn.neighbors.KDTree). The documentation indicates that the supported metric can be found ([scipy.spatial.distance](https://docs.scipy.org/doc/scipy/reference/spatial.distance.html)) and ([distance_metrics](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.distance_metrics.html#sklearn.metrics.pairwise.distance_metrics)). Both of these places show that the `cosine` metric is supported. Also, the [user guide](https://scikit-learn.org/stable/modules/neighbors.html#kdtree-and-balltree-classes) also suggests that cosine is supported as it tries to point out `cosine` as `cosine_distance`. However, it still throws an error for me when I try to use that metric. 

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.neighbors import KDTree
rng = np.random.RandomState(0)
X = rng.random_sample((10, 3))  # 10 points in 3 dimensions
tree = KDTree(X, leaf_size=2, metric= "cosine")              
```

### Expected Results

No error is thrown

### Actual Results

```
Traceback (most recent call last):
  File "sklearn/metrics/_dist_metrics.pyx", line 270, in sklearn.metrics._dist_metrics.DistanceMetric.get_metric
KeyError: 'cosine'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sklearn/neighbors/_binary_tree.pxi", line 844, in sklearn.neighbors._kd_tree.BinaryTree.__init__
  File "sklearn/metrics/_dist_metrics.pyx", line 272, in sklearn.metrics._dist_metrics.DistanceMetric.get_metric
ValueError: Unrecognized metric 'cosine'
```

### Versions

```shell
System:
    python: 3.8.10 (default, Mar 15 2022, 12:22:08)  [GCC 9.4.0]
executable: /bin/python3
   machine: Linux-5.4.0-132-generic-x86_64-with-glibc2.29

Python dependencies:
      sklearn: 1.2.0
          pip: 22.3.1
   setuptools: 65.6.3
        numpy: 1.23.3
        scipy: 1.9.3
       Cython: 0.29.30
       pandas: 1.4.2
   matplotlib: 3.6.2
       joblib: 1.2.0
threadpoolctl: 3.1.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /usr/local/lib/python3.8/dist-packages/numpy.libs/libopenblas64_p-r0-742d56dc.3.20.so
        version: 0.3.20
threading_layer: pthreads
   architecture: SkylakeX
    num_threads: 28

       user_api: openmp
   internal_api: openmp
         prefix: libgomp
       filepath: /usr/local/lib/python3.8/dist-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0
        version: None
    num_threads: 28

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /usr/local/lib/python3.8/dist-packages/scipy.libs/libopenblasp-r0-41284840.3.18.so
        version: 0.3.18
threading_layer: pthreads
   architecture: SkylakeX
    num_threads: 28

       user_api: openmp
   internal_api: openmp
         prefix: libgomp
       filepath: /usr/local/lib/python3.8/dist-packages/torch/lib/libgomp-a34b3233.so.1
        version: None
    num_threads: 14
```

COMMENT:
Hi @01-vyom! Thanks for the issue.

As far as I can see, sklearn.neighbors.KDTree can only be used with Minkowski distances (with $p \in [1, \infty )$):

```python
from sklearn.neighbors import KDTree
KDTree.valid_metrics
>>> ['euclidean', 'l2', 'minkowski', 'p', 'manhattan', 'cityblock', 'l1', 'chebyshev', 'infinity']
```
For some reason, the documentation here:

![image](https://user-images.githubusercontent.com/55899543/211972773-d9dfe01c-1708-49be-a24d-d47692c50496.png)

is rendered in a way that makes it not obvious to run the code above (because of the lowercase and the underline).

When KDTree (and BallTree) inherit the docs from BinaryTree, the class name is given to `BinaryTree`, not `binary_tree`.

https://github.com/scikit-learn/scikit-learn/blob/02ebf9e68fe1fc7687d9e1047b9e465ae0fd945e/sklearn/neighbors/_kd_tree.pyx#L7

https://github.com/scikit-learn/scikit-learn/blob/00f3910678d2b64ddc5be81255a093b97396c580/sklearn/neighbors/_binary_tree.pxi#L285-L290

So maybe changing here to `BinaryTree` can help:

https://github.com/scikit-learn/scikit-learn/blob/00f3910678d2b64ddc5be81255a093b97396c580/sklearn/neighbors/_binary_tree.pxi#L289

As for the [user guide](https://scikit-learn.org/stable/modules/neighbors.html#kdtree-and-balltree-classes), I agree that, in 1.6.1.2, the text

> For a list of available metrics, see the documentation of the DistanceMetric class and the metrics listed in sklearn.metrics.pairwise.PAIRWISE_DISTANCE_FUNCTIONS. Note that the “cosine” metric uses [cosine_distances](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.cosine_distances.html#sklearn.metrics.pairwise.cosine_distances).

makes it confusing to understand that you should not use "cosine" for KDTree and probably should be erased (or moved to another part of the text, such as in 1.6.1.1).

Labels: Bug, module:neighbors