Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/learn-poi.py @ 1012:01db14e947e4
resolved
| author | Wendlasida |
|---|---|
| date | Fri, 01 Jun 2018 10:47:49 -0400 |
| parents | 933670761a57 |
| children | cc5cb04b04b0 |
comparison
equal
deleted
inserted
replaced
| 1011:4f0312bee393 | 1012:01db14e947e4 |
|---|---|
| 1 #! /usr/bin/env python | 1 #! /usr/bin/env python3 |
| 2 | 2 |
| 3 import argparse | 3 import argparse |
| 4 | 4 |
| 5 import numpy as np | 5 import numpy as np |
| 6 from sklearn import mixture | 6 from sklearn import mixture |
| 76 gmmId += 1 | 76 gmmId += 1 |
| 77 | 77 |
| 78 if args.assign: | 78 if args.assign: |
| 79 storage.savePOIAssignments(args.databaseFilename, objects) | 79 storage.savePOIAssignments(args.databaseFilename, objects) |
| 80 if args.displayPaths: | 80 if args.displayPaths: |
| 81 for i in xrange(args.nOriginClusters): | 81 for i in range(args.nOriginClusters): |
| 82 for j in xrange(args.nDestinationClusters): | 82 for j in range(args.nDestinationClusters): |
| 83 odObjects = [o for o in objects if o.od[0] == i and o.od[1] == j] | 83 odObjects = [o for o in objects if o.od[0] == i and o.od[1] == j] |
| 84 if len(odObjects) > 0: | 84 if len(odObjects) > 0: |
| 85 fig = plt.figure() | 85 fig = plt.figure() |
| 86 ax = fig.add_subplot(111) | 86 ax = fig.add_subplot(111) |
| 87 ml.plotGMM(models['beginning'].means_[i], models['beginning'].covariances_[i], i, fig, 'b') | 87 ml.plotGMM(models['beginning'].means_[i], models['beginning'].covariances_[i], i, fig, 'b') |
