[scikit-learn] Complex variables in Gaussian mixture models?

federico vaggi vaggi.federico at gmail.com
Mon Jan 9 15:42:24 EST 2017


Probably not the most principled way to handle it, but: can't you treat 1
dimensional complex numbers as 2 dimensional real numbers, and then try to
cluster those with the GMM?

On Mon, 9 Jan 2017 at 20:34 Rory Smith <smith_r at ligo.caltech.edu> wrote:

> Hi All,
>
> I’d like to set up a GMM using mixture.BayesianGaussianMixture to model a
> probability density of complex random variables (the learned means and
> covariances should also be complex valued). I wasn’t able to see any
> mention of how to handle complex variables in the documentation so I’m
> curious if it’s possible in the current implementation.
> I tried the obvious thing of first generating a 1D array of  complex
> random numbers, but I see these warning when I try and fit the array X
> using
>
> dpgmm = mixture.BayesianGaussianMixture(n_components=4,
>                                         covariance_type='full', n_init=1
> ).fit(X)
>
> ~/miniconda2/lib/python2.7/site-packages/sklearn/utils/validation.py:382:
> ComplexWarning: Casting complex values to real discards the imaginary part
>   array = np.array(array, dtype=dtype, order=order, copy=copy)
>
>
> And as might be expected from the warning, the learned means are real.
>
> Any advice on this problem would be greatly appreciated!
>
> Best,
> Rory
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20170109/cbe7cba8/attachment.html>


More information about the scikit-learn mailing list