Mercurial > hg > nsaunier > traffic-intelligence
comparison python/tests/storage.txt @ 872:c70adaeeddf5
solved issue with latest version of scikit-learn
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 08 Feb 2017 16:32:15 -0500 |
| parents | 6db83beb5350 |
| children | 000555430b28 |
comparison
equal
deleted
inserted
replaced
| 871:6db83beb5350 | 872:c70adaeeddf5 |
|---|---|
| 90 >>> from numpy.random import random_sample | 90 >>> from numpy.random import random_sample |
| 91 >>> nPoints = 50 | 91 >>> nPoints = 50 |
| 92 >>> points = random_sample(nPoints*2).reshape(nPoints,2) | 92 >>> points = random_sample(nPoints*2).reshape(nPoints,2) |
| 93 >>> gmm = GaussianMixture(4, covariance_type = 'full') | 93 >>> gmm = GaussianMixture(4, covariance_type = 'full') |
| 94 >>> tmp = gmm.fit(points) | 94 >>> tmp = gmm.fit(points) |
| 95 >>> id = 0 | 95 >>> gmmId = 0 |
| 96 >>> savePOIs('pois-tmp.sqlite', gmm, 'end', id) | 96 >>> savePOIs('pois-tmp.sqlite', gmm, 'end', gmmId) |
| 97 >>> reloadedGmm = loadPOIs('pois-tmp.sqlite') | 97 >>> reloadedGmm = loadPOIs('pois-tmp.sqlite') |
| 98 >>> sum(gmm.predict(points) == reloadedGmm[id].predict(points)) == nPoints | 98 >>> sum(gmm.predict(points) == reloadedGmm[gmmId].predict(points)) == nPoints |
| 99 True | 99 True |
| 100 >>> reloadedGmm[id].gmmTypes[0] == 'end' | 100 >>> reloadedGmm[gmmId].gmmTypes[0] == 'end' |
| 101 True | 101 True |
| 102 >>> remove('pois-tmp.sqlite') | 102 >>> remove('pois-tmp.sqlite') |
