@@ -74,7 +74,7 @@ def kneighbors_graph(
7474 Parameters
7575 ----------
7676 X : array-like of shape (n_samples, n_features)
77- Sample data, in the form of a numpy array .
77+ Sample data.
7878
7979 n_neighbors : int
8080 Number of neighbors for each sample.
@@ -148,6 +148,19 @@ def kneighbors_graph(
148148 return X .kneighbors_graph (X = query , n_neighbors = n_neighbors , mode = mode )
149149
150150
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+ )
151164def radius_neighbors_graph (
152165 X ,
153166 radius ,
@@ -168,9 +181,8 @@ def radius_neighbors_graph(
168181
169182 Parameters
170183 ----------
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.
174186
175187 radius : float
176188 Radius of neighborhoods.
0 commit comments