Skip to content

Commit 531a28f

Browse files
committed
Finished gmm.score python function.
1 parent 81b4269 commit 531a28f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

python/gmmmodule.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ GMM_score(GMMObject *self, PyObject *args, PyObject *keywds)
210210
free(X);
211211
Py_DECREF(X_array);
212212

213-
return Py_BuildValue("");
213+
return Py_BuildValue("d", llh);
214214
}
215215

216216
static PyMemberDef GMM_members[] = {

python/test.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
st = time.time()
1111
g1 = gmm.GMM(k=3, CovType='diagonal', InitMethod='kmeans')
1212
g1.fit(X)
13-
g1.score(X)
13+
llh = g1.score(X)
14+
print 'Score = ' + str(llh)
1415
en = time.time()
1516
print 'time1 = ' + str(en-st) + ' s'
1617

0 commit comments

Comments
 (0)