Closed
Description
GMM is not happy with dtype=object
in some cases.
I'm not sure if there is an open issue on handling dtype='object'.
I think we should try to convert to float in check_array
if dtype=object
.
Does anyone remember where the discussion about this was?
I think #4006 is related (we should collect dtype object issues somewhere).
to reproduce
from sklearn import mixture
from sklearn.datasets import make_blobs
X, _ = make_blobs()
X = X.astype(object)
g = mixture.GMM(covariance_type='full',n_components=4) #for some reason only full works
g.fit(X)
#works
print g.bic(X)
g = mixture.GMM(covariance_type='diag',n_components=4) #for some reason only full works
g.fit(X)
#fails:
print g.bic(X)