寻找一种方法来查找“ y”矩阵的相关性,但结果总是得到(nan)值!!!!这是我的代码。
n_r = len(y)
n_c = len(y)
A = sparse.dok_matrix((n_r, n_c), dtype=np.float32)
for i in range(n_r):
for j in range(n_c):
v_i = X.toarray()[i, :]
v_j = X.toarray()[j, :]
print(v_j)
correlation = stats.pearsonr(v_i, v_j)
print(correlation)