Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using greedy_IPD(Testdata,dims,35) #8

Open
alifarhat40 opened this issue Mar 27, 2024 · 3 comments
Open

Error using greedy_IPD(Testdata,dims,35) #8

alifarhat40 opened this issue Mar 27, 2024 · 3 comments

Comments

@alifarhat40
Copy link

Hello,

@niclaspopp
I am having trouble running this basic command. I updated all relevant packages, but I am not sure how to debug this. Any help please?

ipd = greedy_IPD(Testdata,dims,35)

WARNING: both StatsBase and Distances export "pairwise"; uses of it in module Clustering must be qualified
WARNING: both StatsBase and Distances export "pairwise!"; uses of it in module Clustering must be qualified
UndefVarError: pairwise not defined

Stacktrace:
[1] _kmeans!(X::Adjoint{Float64, Vector{Float64}}, weights::Nothing, centers::Matrix{Float64}, maxiter::Int64, tol::Float64, displevel::Int64, distance::Distances.SqEuclidean, rng::Random._GLOBAL_RNG)
@ Clustering C:\Users\alifa.julia\packages\Clustering\lI5MF\src\kmeans.jl:141
[2] kmeans!(X::Adjoint{Float64, Vector{Float64}}, centers::Matrix{Float64}; weights::Nothing, maxiter::Int64, tol::Float64, display::Symbol, distance::Distances.SqEuclidean, rng::Random._GLOBAL_RNG)
@ Clustering C:\Users\alifa.julia\packages\Clustering\lI5MF\src\kmeans.jl:71
[3] kmeans(X::Adjoint{Float64, Vector{Float64}}, k::Int64; weights::Nothing, init::Symbol, maxiter::Int64, tol::Float64, display::Symbol, distance::Distances.SqEuclidean, rng::Random._GLOBAL_RNG)
@ Clustering C:\Users\alifa.julia\packages\Clustering\lI5MF\src\kmeans.jl:114
[4] kmeans(X::Adjoint{Float64, Vector{Float64}}, k::Int64)
@ Clustering C:\Users\alifa.julia\packages\Clustering\lI5MF\src\kmeans.jl:95
[5] greedy_IPD(M::Matrix{Float64}, ndim::Int64, T::Int64, disc::Symbol, skip::Vector{Any}, limit::Int64)
@ MultivariateDiscretization C:\Users\alifa.julia\packages\MultivariateDiscretization\D0sKt\src\IPD.jl:225
[6] greedy_IPD(M::Matrix{Float64}, ndim::Int64, T::Int64)
@ MultivariateDiscretization C:\Users\alifa.julia\packages\MultivariateDiscretization\D0sKt\src\IPD.jl:188
[7] top-level scope
@ In[4]:1

@niclaspopp
Copy link
Owner

niclaspopp commented Mar 29, 2024

Hi alifarhat40, thanks for asking the question and pointing out the error! It seems like the error comes from the call of kmeans in line 225 as both StatsBase and Distances export the same function (which has been changed since the release of the package). Thus, it has to be specified which package to use. I'll try to debug that and test it and will push the fix when it's working.

@alifarhat40
Copy link
Author

alifarhat40 commented Mar 30, 2024

Thanks.

I don't know why they say it has been resolved here even though it still gives same error:

JuliaStats/Clustering.jl#274 (comment)

@alifarhat40
Copy link
Author

@niclaspopp

I did some changes and managed to get all the functions to run except for the function:

ipd_clustered = greedy_IPD_clustered(Testdata,dims,35,3);

Any idea why it does not run?

image

Also, can you help me interpret your output here for the ipd = greedy_IPD(Testdata,dims,35)

What do the values here represent? are those the bin index for each data point per dimension?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants