Skip to content

Commit 650005c

Browse files
authored
[DOCs] Update kNN docs with metrics (#982) (#985)
1 parent 091d16e commit 650005c

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

doc/sources/algorithms.rst

+21-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on CPU
2626
------
2727

2828
.. list-table::
29-
:widths: 10 10 30 15
29+
:widths: 10 10 35 15
3030
:header-rows: 1
3131
:align: left
3232

@@ -48,7 +48,13 @@ on CPU
4848
- Multi-output and sparse data are not supported.
4949
* - Classification
5050
- KNeighborsClassifier
51-
- All parameters except ``metric`` != 'euclidean' or ``minkowski`` with ``p`` != 2.
51+
-
52+
- For ``algorithm`` == 'kd_tree':
53+
54+
all parameters except ``metric`` != 'euclidean' or 'minkowski' with ``p`` != 2
55+
- For ``algorithm`` == 'brute':
56+
57+
all parameters except ``metric`` not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']
5258
- Multi-output and sparse data is not supported.
5359
* - Classification
5460
- LogisticRegression
@@ -104,7 +110,13 @@ on CPU
104110
- Sparse data is not supported.
105111
* - Unsupervised
106112
- NearestNeighbors
107-
- All parameters except ``metric`` != 'euclidean' or 'minkowski' with ``p`` != 2.
113+
-
114+
- For ``algorithm`` == 'kd_tree':
115+
116+
all parameters except ``metric`` != 'euclidean' or 'minkowski' with ``p`` != 2
117+
- For ``algorithm`` == 'brute':
118+
119+
all parameters except ``metric`` not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']
108120
- Sparse data is not supported.
109121
* - Other
110122
- train_test_split
@@ -145,7 +157,7 @@ on GPU
145157
- Multi-output, sparse data, out-of-bag score and sample_weight are not supported.
146158
* - Classification
147159
- KNeighborsClassifier
148-
- All parameters except ``algorithm`` != 'brute', ``weights`` = 'callable'
160+
- All parameters except ``algorithm`` != 'brute', ``weights`` = 'callable', ``metric`` not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine'].
149161
- Only dense data is supported.
150162
* - Classification
151163
- LogisticRegression
@@ -157,7 +169,7 @@ on GPU
157169
- Multi-output, sparse data, out-of-bag score and sample_weight are not supported.
158170
* - Regression
159171
- KNeighborsRegressor
160-
- All parameters except ``algorithm`` != 'brute', ``weights`` = 'callable'
172+
- All parameters except ``algorithm`` != 'brute', ``weights`` = 'callable', ``metric`` != 'euclidean' or 'minkowski' with ``p`` != 2.
161173
- Only dense data is supported.
162174
* - Regression
163175
- LinearRegression
@@ -175,6 +187,10 @@ on GPU
175187
- PCA
176188
- All parameters except ``svd_solver`` != 'full'.
177189
- Sparse data is not supported.
190+
* - Unsupervised
191+
- NearestNeighbors
192+
- All parameters except ``algorithm`` != 'brute', ``weights`` = 'callable', ``metric`` not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine'].
193+
- Only dense data is supported.
178194

179195
.. seealso:: :ref:`oneapi_gpu`
180196

0 commit comments

Comments
 (0)