A question about Clustering.jl

This is my code:

using Clustering 
#dist = Distances.Euclidean()
X1 = rand(10, 10)

#dm = Distances.pairwise(dist, X1, dims=2)
 ppresult=kmeans(X1,2)

But it has the following errors:
ERROR: LoadError: UndefVarError: pairwise not defined
Stacktrace:
[1] _kmeans!(X::Matrix{Float64}, weights::Nothing, centers::Matrix{Float64}, maxiter::Int64, tol::Float64, displevel::Int64, distance::SqEuclidean)
@ Clustering C:\Users\dell.julia\packages\Clustering\tt9vc\src\kmeans.jl:138
[2] kmeans!(X::Matrix{Float64}, centers::Matrix{Float64}; weights::Nothing, maxiter::Int64, tol::Float64, display::Symbol, distance::SqEuclidean)
@ Clustering C:\Users\dell.julia\packages\Clustering\tt9vc\src\kmeans.jl:70
[3] kmeans(X::Matrix{Float64}, k::Int64; weights::Nothing, init::Symbol, maxiter::Int64, tol::Float64, display::Symbol, distance::SqEuclidean)
@ Clustering C:\Users\dell.julia\packages\Clustering\tt9vc\src\kmeans.jl:112
[4] kmeans(X::Matrix{Float64}, k::Int64)
@ Clustering C:\Users\dell.julia\packages\Clustering\tt9vc\src\kmeans.jl:103
[5] top-level scope
@ untitled-7219c8427da4c703ddc83ce3a14e097e:6
[6] eval
@ .\boot.jl:360 [inlined]
[7] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1116
in expression starting at untitled-7219c8427da4c703ddc83ce3a14e097e:6

why??thank you!!

1 Like

duplicated:

I don’t think this helps.
You could instead edit the title of your original thread.

1 Like