Mercurial Hosting > traffic-intelligence
diff python/ml.py @ 511:ad518f0c3218
merged pulling from main
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 28 May 2014 17:46:38 -0400 |
parents | c81cbd6953fb |
children | 727e3c529519 |
line wrap: on
line diff
--- a/python/ml.py Fri May 23 17:33:11 2014 -0400 +++ b/python/ml.py Wed May 28 17:46:38 2014 -0400 @@ -24,8 +24,8 @@ def train(self, samples, responses): self.model.train(samples, responses, params = self.params) - def predict(self, sample): - return np.float32(self.model.predict(s)) + def predict(self, samples): + return np.float32([self.model.predict(s) for s in samples]) class Centroid: