python本身實現PCA降維

# -*- coding:utf-8 -*- # /usr/bin/python import numpy as np x = np.array([[1,2,3],[2,3,4],[1,2,5],[1,5,6],[2,5,7],[1,7,2],[4,1,1]]) x_mean = np.mean(x,axis=0) #取均值 x_nor = x-x_mean #計算協方差 x_cov = np.c
相關文章
相關標籤/搜索