How to get `skbio` PCoA (Principal Coordinate Analysis) results?
<p>I'm looking at the <code>attributes</code> of <code>skbio's</code> <code>PCoA</code> method (listed below).  I am new to this <code>API</code> and I want to be able to get the <code>eigenvectors</code> and the original points projected onto the new axis similar to <code>.fit_transform</code> in <code>sklearn.decomposition.PCA</code> so I can create some <code>PC_1 vs PC_2</code>-style plots. I figured out how to get the <code>eigvals</code> and <code>proportion_explained</code> but <code>features</code> comes back as <code>None</code>.  </p>

<p>Is that because it's in beta? </p>

<p>If there are any tutorials that use this, that would be greatly appreciated.  I am a huge fan of <code>scikit-learn</code> and would like to start using more of <code>scikit's</code> products. </p>

<pre><code>|  Attributes
 |  ----------
 |  short_method_name : str
 |      Abbreviated ordination method name.
 |  long_method_name : str
 |      Ordination method name.
 |  eigvals : pd.Series
 |      The resulting eigenvalues.  The index corresponds to the ordination
 |      axis labels
 |  samples : pd.DataFrame
 |      The position of the samples in the ordination space, row-indexed by the
 |      sample id.
 |  features : pd.DataFrame
 |      The position of the features in the ordination space, row-indexed by
 |      the feature id.
 |  biplot_scores : pd.DataFrame
 |      Correlation coefficients of the samples with respect to the features.
 |  sample_constraints : pd.DataFrame
 |      Site constraints (linear combinations of constraining variables):
 |      coordinates of the sites in the space of the explanatory variables X.
 |      These are the fitted site scores
 |  proportion_explained : pd.Series
 |      Proportion explained by each of the dimensions in the ordination space.
 |      The index corresponds to the ordination axis labels
</code></pre>

<p>Here is my code to generate the <code>principal component analysis</code> object. </p>

<pre><code>import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn.preprocessing import StandardScaler
from sklearn import decomposition
import seaborn as sns; sns.set_style("whitegrid", {'axes.grid' : False})
import skbio
from scipy.spatial import distance

%matplotlib inline
np.random.seed(0)

# Iris dataset
DF_data = pd.DataFrame(load_iris().data, 
                       index = ["iris_%d" % i for i in range(load_iris().data.shape[0])],
                       columns = load_iris().feature_names)
n,m = DF_data.shape
# print(n,m)
# 150 4

Se_targets = pd.Series(load_iris().target, 
                       index = ["iris_%d" % i for i in range(load_iris().data.shape[0])], 
                       name = "Species")

# Scaling mean = 0, var = 1
DF_standard = pd.DataFrame(StandardScaler().fit_transform(DF_data), 
                           index = DF_data.index,
                           columns = DF_data.columns)

# Distance Matrix
Ar_dist = distance.squareform(distance.pdist(DF_standard.T, metric="braycurtis")) # (m x m) distance measure
DM_dist = skbio.stats.distance.DistanceMatrix(Ar_dist, ids=DF_standard.columns)
PCoA = skbio.stats.ordination.pcoa(DM_dist)
</code></pre>

<p><a href="https://i.stack.imgur.com/9Net0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Net0.png" alt="enter image description here"></a></p>