コード例 #1
0
 def setup(self):
     """Data from table 9.11 in Legendre & Legendre 1998."""
     self.X = np.loadtxt(get_data_path('L&L_CA_data'))
     self.ordination = CA(self.X, ['Site1', 'Site2', 'Site3'],
                          ['Species1', 'Species2', 'Species3'])
コード例 #2
0
 def test_negative(self):
     X = np.array([[1, 2], [-0.1, -2]])
     with npt.assert_raises(ValueError):
         CA(X, None, None)
コード例 #3
0
ファイル: ordination.py プロジェクト: sriki18/scikit-bio
import os
import numpy as np

from skbio.math.stats.ordination import CA, RDA, CCA


path = os.path.dirname(os.path.abspath(__file__))


def get_path(fn):
    return os.path.join(path, os.pardir, 'math', 'stats', 'ordination',
                        'test', 'data', fn)

X = np.loadtxt(get_path('L&L_CA_data'))
ordint = CA(X)
ordint.biplot(1)
ordint.biplot(2)

Y = np.loadtxt(get_path('example2_Y'))
X = np.loadtxt(get_path('example2_X')).reshape(-1, 4, order='F')
ordint = RDA(Y, X)
ordint.biplot()

Y = np.loadtxt(get_path('example3_Y'))
X = np.loadtxt(get_path('example3_X')).reshape(-1, 4, order='F')
ordint = CCA(Y, X)
ordint.biplot()