skbio.stats.ordination.
pcoa
(distance_matrix)[source]¶Perform Principal Coordinate Analysis.
State: Experimental as of 0.4.0.
Principal Coordinate Analysis (PCoA) is a method similar to PCA that works from distance matrices, and so it can be used with ecologically meaningful distances like UniFrac for bacteria.
In ecology, the euclidean distance preserved by Principal Component Analysis (PCA) is often not a good choice because it deals poorly with double zeros (Species have unimodal distributions along environmental gradients, so if a species is absent from two sites at the same site, it can’t be known if an environmental variable is too high in one of them and too low in the other, or too low in both, etc. On the other hand, if an species is present in two sites, that means that the sites are similar.).
Parameters:  distance_matrix : DistanceMatrix


Returns:  OrdinationResults

See also
Notes
It is sometimes known as metric multidimensional scaling or classical scaling.
Note
If the distance is not euclidean (for example if it is a semimetric and the triangle inequality doesn’t hold), negative eigenvalues can appear. There are different ways to deal with that problem (see Legendre & Legendre 1998, S 9.2.3), but none are currently implemented here.
However, a warning is raised whenever negative eigenvalues appear, allowing the user to decide if they can be safely ignored.