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

[Question] - Equivalent of sklearn GaussianMixture.predict?

Open vikram-s-narayan opened this issue 2 years ago • 1 comments

How does one do the equivalent of the following code with GaussianMixtures.jl?

import numpy as np
from sklearn.mixture import GaussianMixture
X = np.array([[1, 2], [1, 4], [1, 0], [10, 2], [10, 4], [10, 0]])
gm = GaussianMixture(n_components=2, random_state=0).fit(X)
gm.predict([[0, 0], [12, 3]]) #prints "array([1, 0])"

Thanks in advance for any pointers :)

vikram-s-narayan avatar Aug 08 '22 08:08 vikram-s-narayan

I recall that I had included a PR providing such an interface, see scikitlearn.jl.

It might be that we need some better documentation, which currently is pretty poor anyways.

davidavdav avatar Aug 21 '22 13:08 davidavdav