Mercurial Hosting > traffic-intelligence
diff python/ml.py @ 501:c81cbd6953fb
update to classify speed to remove data at both ends
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 20 May 2014 15:18:55 -0400 |
parents | 8bc632cb8344 |
children | 727e3c529519 |
line wrap: on
line diff
--- a/python/ml.py Fri May 09 14:09:14 2014 -0400 +++ b/python/ml.py Tue May 20 15:18:55 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: