def pearson_correlation_matrix(X):
"""
Computes the Pearson Correlation matrix
Keyword arguments:
X -- The feature vectors
"""
n_features=len(X[0])
correlation_matrix=np.zeros(shape=(n_features,n_features))
for i in xrange(n_features):
for j in xrange(n_features):
pearson_corr=stats.pearsonr(X[:,i],X[:,j])[0]
correlation_matrix[i][j]=pearson_corr
return correlation_matrix
feature_selection.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录