Skip to content

Commit

Permalink
Improved euclidian distance for kmeans
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviotruzzi committed May 15, 2012
1 parent bb78003 commit f5d952a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cython/EMGMM.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ cdef MStep(int n_mixture, np.ndarray[DTYPE_t, ndim=2] data,
# Fit #
##############################################################################
cdef fit(unsigned int iter, int n_mixture,

np.ndarray[DTYPE_t, ndim=2] data,
np.ndarray[DTYPE_t, ndim=2] means,
np.ndarray[DTYPE_t, ndim=3] covars,
Expand Down Expand Up @@ -372,7 +371,7 @@ class EMGMM:
self.means = kmeans(n_mixture, data)[0]
self.z = np.zeros((data.shape[0], n_mixture))

self.pk = np.ones((n_mixture,1)) / n_mixture
self.pk = np.ones((n_mixture,)) / n_mixture

self.coefs = np.zeros((n_mixture,))
self.inv_covars = np.zeros(self.covars.shape)
Expand Down

0 comments on commit f5d952a

Please sign in to comment.