How can I use PCA/SVD in Python for feature selection AND identification?

六眼飞鱼酱① 提交于 2019-12-03 21:18:33

I was under the wrong impression that PCA did feature selection, whereas instead it does feature extraction.

Instead, PCA creates a new series of features, each of which is a combination of the input features.

From PCA, if you really wanted to do feature selection, you could look at the weightings of the input features on the PCA created features. For instance, the matplotlib.mlab.PCA library provides the weights in a property (more on library):

from matplotlib.mlab import PCA
res = PCA(data)
print "weights of input vectors: %s" % res.Wt

Sounds like the feature extraction route is the way to use PCA though.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!