Mercurial Hosting > traffic-intelligence
comparison scripts/learn-poi.py @ 871:6db83beb5350
work in progress to update gaussian mixtures
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 03 Feb 2017 16:26:18 -0500 |
parents | 5a68779d7777 |
children | 1cd878812529 |
comparison
equal
deleted
inserted
replaced
870:1535251a1f40 | 871:6db83beb5350 |
---|---|
38 gmmId=0 | 38 gmmId=0 |
39 for nClusters, points, gmmType in zip([args.nOriginClusters, nDestinationClusters], | 39 for nClusters, points, gmmType in zip([args.nOriginClusters, nDestinationClusters], |
40 [beginnings, ends], | 40 [beginnings, ends], |
41 ['beginning', 'end']): | 41 ['beginning', 'end']): |
42 # estimation | 42 # estimation |
43 gmm = mixture.GMM(n_components=nClusters, covariance_type = args.covarianceType) | 43 gmm = mixture.GaussianMixture(n_components=nClusters, covariance_type = args.covarianceType) |
44 model=gmm.fit(beginnings) | 44 model=gmm.fit(beginnings) |
45 if not model.converged_: | 45 if not model.converged_: |
46 print('Warning: model for '+gmmType+' points did not converge') | 46 print('Warning: model for '+gmmType+' points did not converge') |
47 # plot | 47 # plot |
48 if args.display: | 48 if args.display: |