1. 주 성분 분석 Principal component analysis(PCA), 파이썬 코드

2022. 1. 29. 01:38코딩/AI

1. 주성분 분석(PCA; Principal component analysis)는 고차원의 데이터를 저차원의 데이터로 환원시키는 기법을 뜻한다.

 

=> 차원 축소(Diensionality Reduction)

 

이 때, 차원 축소를 위해 직교 변환(orthogonal projection)을 이용한다.

 

 

Projection의 규칙은 Maximum variance이다.

 


2. Maximum Variance Formulation

 

 

이 때, Variance of the projected data는 다음과 같다. (m < d)

w: direction of space( w^Tw = 1)

 

 

 

의 조건은 그냥 '크기' 때문이다.(조건)

 

보라색 밑줄 친 부분이 Covariance matirx of data(= S) 이다. 

 

라그랑즈 승수법(Lagrange multiplier method)를 이용하면

이를 미분하면

 

즉,

는 maximum eigenvalue와 같다.

 

 

 

 


3. PCA의 의미

 

PCA는 차원 축소와 함께 data의 Strongest pattern을 띈다.

 

파이썬 코드

 

PCA using Python (scikit-learn)

My last tutorial went over Logistic Regression using Python. One of the things learned was that you can speed up the fitting of a machine learning algorithm by changing the optimization algorithm. A…

towardsdatascience.com