How to get the 1st Principal Component by PCA using Python?

前端 未结 3 1987
星月不相逢
星月不相逢 2020-12-21 22:55

I have a set of 2D vectors presented in a n*2 matrix form.

I wish to get the 1st principal component, i.e. the vector that indicates the direction with

3条回答
  •  星月不相逢
    2020-12-21 23:42

    Similar question here: Principal component analysis in Python

    Or you could have a look at scikits learn: http://scikit-learn.org/0.13/modules/generated/sklearn.decomposition.PCA.html

提交回复
热议问题