Unfortunately, when the input is a number of clusters X 1 vector, this reshape does nothing, resulting in a bad initial weight vector (because subsequently the initial weights are computed based on the number of
S. Y. Yoon · 2015
When using EM (em.cpp) with the option of starting with the E-step, one provides the initial means, covariance matrices, and weights. The variable weights is a number of clusters by 1 matrix/vector. In em.cpp, in the function EM::setTrainData, the variable weights is reshaped to a 1 x number of clusters vector using the function call