NovembreLab / ancpy

A python package for ancient DNA
0 stars 0 forks source link

pca projection #2

Open jhmarcus opened 6 years ago

jhmarcus commented 6 years ago

using sklearn pca module ...

%%time
pcs_anc = np.empty((g_anc.n, K))
for i in range(g_anc.n):
    idx = ~np.isnan(z_anc[:, i])
    x = np.linalg.lstsq(w[idx, :],  z_anc[idx, i])
    pcs_anc[i, :] = x[0]