davidavdav / GaussianMixtures.jl

Large scale Gaussian Mixture Models
Other
95 stars 36 forks source link

Weights Function Does Not Exist #75

Open smickusGT opened 3 years ago

smickusGT commented 3 years ago

In the documentation it describes a function weights(gm) to get the weights of the mixture model. When I try to use this function however I get an error saying that the function does not exist.

JoshuaPurtell commented 3 years ago

Hi @smickusGT , does the problem persist? The minimal reprex

using GaussianMixtures
g = rand(GMM, 2, 2; kind=:full, sep=2.0)
weights(g)

seems to work.

ForceBru commented 3 years ago

For me it happened when I had using StatsBase, GaussianMixtures in my code. This produced a warning and the UndefVarError:

WARNING: both GaussianMixtures and StatsBase export "weights"; uses of it in module Main must be qualified
UndefVarError: weights not defined

However, this warning doesn't appear 100% of the time, so it can be quite confusing indeed

davidavdav commented 1 year ago

This is a general Julia problem, I think. If packages A and B both define function f which isn't in Base, then these definitions might clash. I think you can always say A.f and B.f to disambiguate.