Skip to content

Question about using knn.radius_neighbors #21

Description

Hi Daniel:

Thank you very much for reading this. This is not quite an issue but a question. I found you are passing a list as radius to knn.radius_neighbors function while I cannot find any documentation about it.

Doc of this function only said that it accepts a float as radius. Can you please help me to understand this code?

# find the distance of the kth in-class point
    for c in classes:
        mask = np.where(y == c)[0]
        knn.fit(x[mask, :])
        d2k[mask] = knn.kneighbors()[0][:, -1]

    # find the number of points within the distance of the kth in-class point
    knn.fit(x)
    m = knn.radius_neighbors(radius=d2k, return_distance=False)
    m = [i.shape[0] for i in m]

Thanks a lot.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions