[scikit-learn] how to make result less number of group with NearestNeighbors?

Shane Grigsby shane.grigsby at colorado.edu
Sun Sep 10 20:45:12 EDT 2017


I think you want to call the radius_neighbors method (check here: 
http://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NearestNeighbors.html#sklearn.neighbors.NearestNeighbors.radius_neighbors) 

(you're using kneighbors, replace with radius_neighbors)

~Shane

On 09/10, Martin Lee wrote:
> nbrs = NearestNeighbors(n_neighbors=10,radius=100.0,metric='euclidean',algorithm='ball_tree').fit(testing1)
>    distances, indices = nbrs.kneighbors(testing1)
>
>just expect when each point distance less than 100 then group into one group
>
>
>Martin

>_______________________________________________
>scikit-learn mailing list
>scikit-learn at python.org
>https://mail.python.org/mailman/listinfo/scikit-learn


-- 
*PhD candidate & Research Assistant*
*Cooperative Institute for Research in Environmental Sciences (CIRES)*
*University of Colorado at Boulder*


More information about the scikit-learn mailing list