On Mon, Nov 19, 2012 at 8:01 PM, Leon Palafox <[email protected]> wrote:
> Hello,
>
> I've been working with some sparse matrices that have the libSVM format.
> They were only on LibSVM format, but where not binary training data, we
> just choose that format for convenience.
>
That's ok, our implementation reads the label as a float, so it can be used
for regression and multiclass classification too.
>
>
I was trying to pass those matrices to a GMM to compare clustering with
> K-means on these datasets.
>
> So I get an X matrix, which is the output from:
>
> X,y=load_svmlight_file(filename)
> ##Then I transpose
> A=X.T
> GMM=mixture.GMM(n_components=2)
> GMM.fit(A)
>
> And here is where I have an error (that I do not have with K means) that
> the X[0].shape < self.n_components
>
The GMM module doesn't support sparse matrices at the moment. Note that
except when covtype="diag", the covariance matrice has a n_feature^2 memory
complexity. So KMeans is more suitable if you want to work with
high-dimensional data.
If your data is not high-dimensional, you can try to do X = X.toarray().
>
> Any idea on why is this happening?
>
>
I think the input checking in GMM is not good enough. PR welcome :)
Mathieu
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general