Added error messages in case user provides one dimensional data#4845
Added error messages in case user provides one dimensional data#4845Carldeboer wants to merge 1 commit intoscikit-learn:masterfrom Carldeboer:master
Conversation
…data (X) When trying to learn a GMM on one dimensional data, both weights and the data can be represented as 1-d vectors. However, this breaks GMM.fit() and it used to die with cryptic error messages. This addition specifically checks for one dimensional input and issues an error accordingly.
|
We should actually fix this for all estimator and test consistently. I'm not sure we want to include this fix. We should probably rather change |
|
Agreed that that would be a better solution, but I don't think that would address problems that arise when So far, I'm unable to determine what the problem is this time. the DPGMM was made using the same 2-d data that succeeded with the GMM and the same command |
|
There is a test case on 1-D dimension data, but the shape of the data is (n, 1). I agreed to fix the problem of using (n,) data in For the problem of |
|
@xuewei4d Yes, that is indeed what I did. I wanted to initialize the means. If you have the means as a 1-d array, then GMM fails. |
|
@Carldeboer I think your probably assign |
|
Arguably fixed via #5152. That will protect against 1d X. I would argue the user is in charge of setting |
When trying to learn a GMM on one dimensional data, both weights and the data can be represented as 1-d vectors. However, this breaks GMM.fit() and it used to die with cryptic error messages. This addition specifically checks for one dimensional input and issues an error message accordingly.