Skip to content
Snippets Groups Projects
Commit efc25e19 authored by Guillaume HEUSCH's avatar Guillaume HEUSCH
Browse files

[algorithm] fixed bug in the log-prob computation of SKLGMM: 2D array is expected

parent 4e95fc5f
Branches
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ class SKLGMM(Algorithm):
# The data - "positive class only"
pos = numpy.array(training_features[0])
features_dim = pos.shape[1]
# train
self.machine.fit(pos)
......@@ -68,7 +68,8 @@ class SKLGMM(Algorithm):
"""
Compute the log-likelihood of the feature
"""
# load
# sklearn.mixture.GaussianMixture expects a 2d array (even with one example)
feature = numpy.expand_dims(feature, axis=0)
return self.machine.score_samples(feature)
def score(self, toscore):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment