> For the complete documentation index, see [llms.txt](https://riverallzero.gitbook.io/summary/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://riverallzero.gitbook.io/summary/data-mining/dimension-reduction.md).

# Dimension Reduction

### SVD(Single Value Dicomposition)

![](/files/rcliXgzJFceLLeJffqB8)

$$A\_{\[mxn]}=U\_{\[mxn]}\sum\_{\[rxr]}{V\_{\[nxr]}}^T$$

* $$A$$: input data matrix
* $$M$$: left singular vectors
* $$\sum$$: singular values
  * $$r$$(=rank of matrix): matrix의 선형 독립적인 column의 개수
* $$V$$: right singular vectors

n차원에서 q차원 축소시킨 $$B=U\_{\[mx(n-q)]}\sum\_{\[(r-q)x(r-q)]}{V\_{\[(n-q)xr]}}^T$$ matrix를 $$B$$라고 하자. 이때 우리는 적정 q를 $$\sqrt{\sum\_{ij}(A\_{ij}-B\_{ij})^2}$$이 최소화되는 경우로 찾으면 된다. 이 값이 작을수록 원래 정보와 차원이 축소된 정보의 차이가 작다는 의미이기 때문이다.

만약 100차원을 줄인다고 할때 적정 차원을 알고싶으면, $$r'$$차원을 임의로 설정하고 $$\frac{\sigma\_1+...+\sigma\_{r'}}{\sigma\_1+\sigma\_2+...+\sigma\_{100}}=0.8 \ or \ 0.9$$인 $$r'$$을 찾으면 된다.
