GaussianMixtures.jl icon indicating copy to clipboard operation
GaussianMixtures.jl copied to clipboard

Weights Function Does Not Exist

Open smickusGT opened this issue 3 years ago • 3 comments

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.

smickusGT avatar Nov 09 '20 23:11 smickusGT

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.

JoshuaPurtell avatar May 25 '21 21:05 JoshuaPurtell

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

ForceBru avatar Jul 15 '21 13:07 ForceBru

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.

davidavdav avatar Aug 21 '22 14:08 davidavdav