# Problem about parameter in NearestNeighbors.jl

**URL:** <https://discourse.julialang.org/t/problem-about-parameter-in-nearestneighbors-jl/63533>\
**Category:** General Usage\
**Tags:** question, package\
**Created:** [June 25, 2021, 7:14am UTC](https://discourse.julialang.org/t/problem-about-parameter-in-nearestneighbors-jl/63533 "2021-06-25T07:14:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zlq178](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zlq178/32/17952_2.png) [@zlq178](https://discourse.julialang.org/u/zlq178)\
**Post date:** [June 25, 2021, 7:14am UTC](https://discourse.julialang.org/t/problem-about-parameter-in-nearestneighbors-jl/63533/1 "2021-06-25T07:14:18Z")

</div>

I find an example from NearestNeighbors.jl package, But I can’t find the explaination to “`idxs`”. What does it mean? What’s more, how to get nearest neighbors and get the predicted value? The example is as follow:

```julia
using NearestNeighbors
data = rand(3, 10^4)
k = 3
point = rand(3)

kdtree = KDTree(data)
idxs, dists = knn(kdtree, point, k, true)

idxs
# 3-element Array{Int64,1}:
# 4683
# 6119
# 3278

dists
# 3-element Array{Float64,1}:
# 0.039032201026256215
# 0.04134193711411951
# 0.042974090446474184

```

Thank you for your answer!

---

<div class="post-metadata">

**Author:** ![cjdoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cjdoris/32/213133_2.png) [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Post date:** [June 27, 2021, 11:37am UTC](https://discourse.julialang.org/t/problem-about-parameter-in-nearestneighbors-jl/63533/2 "2021-06-27T11:37:15Z")

</div>

It means the 4683rd column of `data` is closest to `point`, with distance 0.039. The 6119th column is second closest, and so on.

---

<div class="post-metadata">

**Author:** ![zlq178](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zlq178/32/17952_2.png) [@zlq178](https://discourse.julialang.org/u/zlq178)\
**Post date:** [June 27, 2021, 11:56am UTC](https://discourse.julialang.org/t/problem-about-parameter-in-nearestneighbors-jl/63533/3 "2021-06-27T11:56:02Z")

</div>

Nice！ Thanks for your help!
