Mercurial > hg > nsaunier > traffic-intelligence
comparison python/ml.py @ 998:933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Sun, 27 May 2018 23:22:48 -0400 |
| parents | e8eabef7857c |
| children | 6ba30b259525 |
comparison
equal
deleted
inserted
replaced
| 997:4f3387a242a1 | 998:933670761a57 |
|---|---|
| 304 and the predicted classes of the instances in the dataset''' | 304 and the predicted classes of the instances in the dataset''' |
| 305 if fig is None: | 305 if fig is None: |
| 306 fig = plt.figure() | 306 fig = plt.figure() |
| 307 if len(fig.get_axes()) == 0: | 307 if len(fig.get_axes()) == 0: |
| 308 fig.add_subplot(111) | 308 fig.add_subplot(111) |
| 309 for i in xrange(model.n_components): | 309 for i in range(model.n_components): |
| 310 mean = model.means_[i]/nUnitsPerPixel | 310 mean = model.means_[i]/nUnitsPerPixel |
| 311 covariance = model.covariances_[i]/nUnitsPerPixel | 311 covariance = model.covariances_[i]/nUnitsPerPixel |
| 312 # plot points | 312 # plot points |
| 313 if dataset is not None: | 313 if dataset is not None: |
| 314 tmpDataset = dataset/nUnitsPerPixel | 314 tmpDataset = dataset/nUnitsPerPixel |
