Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# cogent.maths.distance_transform.dist_euclidean

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)

```from numpy import array, sqrt, size
from cogent.cluster.nmds import NMDS, metaNMDS
from cogent.maths.distance_transform import dist_euclidean

__author__ = "Justin Kuczynski"
```
```            [0,0,0,2,4,0,0,0,1],
[0,0,0,1,7,0,0,0,0]], 'float')
distmtx = dist_euclidean(ptmtx)
nm = NMDS(distmtx, verbosity=0)
self.assertLessThan(nm.getStress(), .13)
```
```            [0,0,0,2,4,0,0,0,1],
[0,0,0,1,7,0,0,0,0]], 'float')
distmtx = dist_euclidean(ptmtx)
for dim in range(3,18):
nm = NMDS(distmtx, verbosity=0, dimension=dim)
```
```            [0,0,0,2,4,0,0,0,1],
[0,0,0,1,7,0,0,0,0]], 'float')
distmtx = dist_euclidean(ptmtx)
nm = metaNMDS(1, distmtx, verbosity=0)
self.assertLessThan(nm.getStress(), .13)
```

```from numpy import array, sqrt, size
from cogent.cluster.nmds import NMDS, metaNMDS
from cogent.maths.distance_transform import dist_euclidean

__author__ = "Justin Kuczynski"
```
```            [0,0,0,2,4,0,0,0,1],
[0,0,0,1,7,0,0,0,0]], 'float')
distmtx = dist_euclidean(ptmtx)
nm = NMDS(distmtx, verbosity=0)
self.assertLessThan(nm.getStress(), .13)
```
```            [0,0,0,2,4,0,0,0,1],
[0,0,0,1,7,0,0,0,0]], 'float')
distmtx = dist_euclidean(ptmtx)
for dim in range(3,18):
nm = NMDS(distmtx, verbosity=0, dimension=dim)
```
```            [0,0,0,2,4,0,0,0,1],
[0,0,0,1,7,0,0,0,0]], 'float')
distmtx = dist_euclidean(ptmtx)
nm = metaNMDS(1, distmtx, verbosity=0)
self.assertLessThan(nm.getStress(), .13)
```