@@ -74,7 +74,7 @@ def kneighbors_graph(
74
74
Parameters
75
75
----------
76
76
X : array-like of shape (n_samples, n_features)
77
- Sample data, in the form of a numpy array .
77
+ Sample data.
78
78
79
79
n_neighbors : int
80
80
Number of neighbors for each sample.
@@ -148,6 +148,19 @@ def kneighbors_graph(
148
148
return X .kneighbors_graph (X = query , n_neighbors = n_neighbors , mode = mode )
149
149
150
150
151
+ @validate_params (
152
+ {
153
+ "X" : ["array-like" , RadiusNeighborsMixin ],
154
+ "radius" : [Interval (Real , 0 , None , closed = "both" )],
155
+ "mode" : [StrOptions ({"connectivity" , "distance" })],
156
+ "metric" : [StrOptions (set (itertools .chain (* VALID_METRICS .values ()))), callable ],
157
+ "p" : [Interval (Real , 0 , None , closed = "right" ), None ],
158
+ "metric_params" : [dict , None ],
159
+ "include_self" : ["boolean" , StrOptions ({"auto" })],
160
+ "n_jobs" : [Integral , None ],
161
+ },
162
+ prefer_skip_nested_validation = False , # metric is not validated yet
163
+ )
151
164
def radius_neighbors_graph (
152
165
X ,
153
166
radius ,
@@ -168,9 +181,8 @@ def radius_neighbors_graph(
168
181
169
182
Parameters
170
183
----------
171
- X : array-like of shape (n_samples, n_features) or BallTree
172
- Sample data, in the form of a numpy array or a precomputed
173
- :class:`BallTree`.
184
+ X : array-like of shape (n_samples, n_features)
185
+ Sample data.
174
186
175
187
radius : float
176
188
Radius of neighborhoods.
0 commit comments