profile-img
The merit of an action lies in finishing it to the end.
slide-image

Linear Algebra / μ„ ν˜•λŒ€μˆ˜ν•™

- matrix의 μˆ˜ν•™

- 데이터 κ³Όν•™μ—μ„œ μ€‘μš”ν•œ μ—­ν• 

 

n * m matrixκ°€ λ‚˜νƒ€λ‚Ό 수 μžˆλŠ” 것

  row column
Data object features
Geometric Point Sets point dimensions
Systems of equations equations 각 λ³€μˆ˜μ˜ coefficient

- Graphs/Networks: M[i, j] = vertex i -> vertex j edge 개수

- Vectors: any row, column or d*1 matrix

 

Vector μ‚¬μ΄μ˜ 각 

- 벑터 A와 B μ‚¬μ΄μ˜ 각도

- cos(0) = 1 ---> perfect similarity = 0

- cos(pi/2) = 0 ---> 관련이 μ—†λ‹€

- cos(pi) = -1 ---> perfect anticorrelation

==> cos = correlation of mean zero variables

- unit vector에 λŒ€ν•΄μ„œ κ·Έ λ²‘ν„°μ˜ ν¬κΈ°λŠ” 1μ΄λ―€λ‘œ, dot product둜 μ •μ˜λœλ‹€.

 

Transpose

- μ •μ˜: a*b matrix -> b*a matrix둜 λ³€ν™˜ν•˜λŠ” 것

- addition and transposition

-> B = A^T라고 κ°€μ •ν–ˆμ„ λ•Œ ν•©ν•˜λŠ” 방법

- a 값을 μ‘°μ •ν•  수 있음.

 

Matrix multiplication & Dot Products

- A*BλŠ” 같은 λ‚΄λΆ€ 차원을 κ³΅μœ ν•΄μ•Όλ§Œ 계산 κ°€λŠ₯ν•˜λ‹€.

- κ²°κ³Όν–‰λ ¬μ˜ 각 μš”μ†ŒλŠ” row/column λ²‘ν„°μ˜ dot product 

- dot productλŠ” 두 개의 벑터가 μ–Όλ§ˆλ‚˜ μœ μ‚¬ν•œμ§€ μΈ‘μ •ν•˜λŠ” 방법이닀.

- ν–‰λ ¬μ˜ κ³±μ…ˆμ€ 결합법칙은 μ„±λ¦½ν•˜λ‚˜ κ΅ν™˜λ²•μΉ™μ€ μ„±λ¦½ν•˜μ§€ μ•ŠλŠ”λ‹€.

 

Multiplying Feature Matrices

- ν–‰λ ¬ Aκ°€ n*d data matrix라고 κ°€μ •ν•΄λ³΄μž.

- n: λ¬Έμ„œ, d: μš©μ–΄

- C 행렬은 n*n matrix of dot products - 점듀 κ°„μ˜ μœ μ‚¬λ„λ₯Ό λ‚˜νƒ€λ‚΄λŠ” 행렬이 λœλ‹€.

- D 행렬은 d*d matrix of dot products - νŠΉμ„± κ°„μ˜ μœ μ‚¬λ„λ₯Ό λ‚˜νƒ€λ‚΄λŠ” 행렬이 λœλ‹€.

- covariance matrix 둜 해석할 수 μžˆλ‹€.

μ˜ˆμ‹œ) car - automobile : D matrix 계산 ν›„ 두 값을 λ‚˜νƒ€λ‚΄λŠ” cell을 확인해보면 λ‹€λ₯Έ cell보닀 값이 높은 것을 확인할 수 μžˆλ‹€. - μœ μ‚¬λ„κ°€ λ†’λ‹€.

 

Interpreting Matrix Multiplication

- 0/1 adjacency matrices λ₯Ό κ³±ν•˜λŠ” 것은 두 점 μ‚¬μ΄μ˜ 거리λ₯Ό λ‚˜νƒ€λ‚΄λŠ” 행렬이 λœλ‹€.

- Multiplication by permutation matricesλŠ” ν–‰/열을 μž¬μ •λ ¬ν•œλ‹€.

 

Matrix Rank

- μ •μ˜: μ„ ν˜• 독립적인 row의 수λ₯Ό μΈ‘μ •ν•˜λŠ” 것

- n*n matrixλŠ” μˆœμœ„κ°€ n이 λ˜μ–΄μ•Ό ν•œλ‹€.

Rank 1 인 Matrix - 두 식이 사싀상 같은 μ˜λ―Έμ΄λ―€λ‘œ ν’€ 수 μ—†λ‹€.
Rank 2인 matrix

* λž­ν¬λž€ ν–‰λ ¬μ˜ μ—΄λ“€λ‘œ 생성될 수 μžˆλŠ” 벑터 κ³΅κ°„μ˜ 차원.

μ°Έκ³ λ¬Έν—Œ: https://blog.naver.com/sw4r/221416614473

 

[기초 μ„ ν˜•λŒ€μˆ˜] ν–‰λ ¬μ—μ„œ Rank (랭크) λž€?

μ„ ν˜•λŒ€μˆ˜μ—μ„œ λ“±μž₯ν•˜λŠ” Rank λΌλŠ” κ°œλ…μ— λŒ€ν•΄μ„œ κ°„λž΅ν•˜κ²Œ μ•Œμ•„λ³΄μž.  μœ„ν‚€μ˜ μ •μ˜λ₯Ό μš°μ„  확인해보...

blog.naver.com

 

2=1 증λͺ…μœΌλ‘œλΆ€ν„° μ•Œ 수 μžˆλŠ” 것

- 증λͺ…에 였λ₯˜κ°€ μƒκΈ°λŠ” 원인: 0으둜 λ‚˜λˆ„λŠ” 것이 λΆˆκ°€λŠ₯ν•˜λ‹€λŠ” 것을 간과함

- μ„ ν˜• λŒ€μˆ˜μ—μ„œ singular matrix도 ν¬ν•¨λœλ‹€.

 

Matrixλ₯Ό λ‚˜λˆ„λŠ” 것

- inverse operation: xλ₯Ό identity element둜 λ‚΄λ¦¬λŠ” 것

- κ³±μ…ˆμ˜ inverseλŠ” λ‚˜λˆ—μ…ˆ.

- λ§μ…ˆμ˜ inverseλŠ” λΊ„μ…ˆ.

 

Matrix Inversion

- A^-1 : A * A^-1 = I 인 matrix (I = identity matrix)

- A 행렬이 inverseλ₯Ό 가진닀면, Gaussian elimination을 μ΄μš©ν•˜μ—¬ 계산될 수 μžˆλ‹€.

* κ°€μš°μŠ€ μ†Œκ±°λ²•

https://m.blog.naver.com/siri0831/222033492473

 

μ„ ν˜•λŒ€μˆ˜ν•™(1) - κ°€μš°μŠ€ μ†Œκ±°λ²•(Gauss Elimination)

μ•ˆλ…•ν•˜μ„Έμš”! μ˜€λŠ˜λΆ€ν„° μ„ ν˜•λŒ€μˆ˜ν•™μ„ μ‘°κΈˆμ”© 올렀 μ •λ¦¬ν•΄λ³ΌκΉŒ ν•΄μš”~ λŒ€ν•™κ΅ μž…ν•™ν•˜μ—¬ λͺ¨λ‘λ“€ 처음 μ ‘ν•˜κ²Œ 될...

blog.naver.com

 

Matrix Inversion and Linear Systems

- Ax=b 식에 A의 μ—­ν–‰λ ¬ A^-1을 κ³±ν•˜λ©΄ λ‹€μŒμ˜ 식이 λ‚˜νƒ€λ‚œλ‹€.

- μ„ ν˜•μ‹μ˜ ν•΄λ₯Ό κ΅¬ν•˜λŠ” 것은 matrix의 역행렬을 κ³±ν•˜λŠ” 것과 κ°™λ‹€.

Principle Component Analysis (PCA)

- 데이터λ₯Ό 2개의 μΆ•μœΌλ‘œ projectionν•˜λŠ” 것이닀.

- μ–΄λ–€ κΈ°μ€€μœΌλ‘œ 좕을 골라야 ν•  것인가?

1) 1차원 projection을 ν–ˆμ„ λ•Œ 데이터 뢄산이 κ°€μž₯ 큰 것을 μ„ νƒν•œλ‹€.

* 이유: 정보 μœ μ‹€μ„ μ΅œμ†Œν™”ν•΄μ•Όν•˜λ―€λ‘œ

2) 첫번째 μΆ•κ³Ό μ§κ΅ν•˜λ©΄μ„œ 뢄산이 κ°€μž₯ 큰 좕을 μ„ νƒν•œλ‹€. --> μƒˆλ‘œμš΄ 곡간을 λ§Œλ“€μ–΄λ‚Έλ‹€.

 

Singular Value Decomposition (SVD) : νŠΉμ΄κ°’ λΆ„ν•΄

- 이미지 처리 등에 μ‚¬μš©λ¨

- V*, U*λŠ” 각 ν–‰λ ¬μ˜ 역행렬이라고 μƒκ°ν•˜λ©΄ 됨

- https://darkpgmr.tistory.com/106

 

[μ„ ν˜•λŒ€μˆ˜ν•™ #4] νŠΉμ΄κ°’ λΆ„ν•΄(Singular Value Decomposition, SVD)의 ν™œμš©

ν™œμš©λ„ μΈ‘λ©΄μ—μ„œ μ„ ν˜•λŒ€μˆ˜ν•™μ˜ 꽃이라 ν•  수 μžˆλŠ” νŠΉμ΄κ°’ λΆ„ν•΄(Singular Value Decomposition, SVD)에 λŒ€ν•œ λ‚΄μš©μž…λ‹ˆλ‹€. 보톡은 λ³΅μ†Œμˆ˜ 곡간을 ν¬ν•¨ν•˜μ—¬ μ •μ˜ν•˜λŠ” 것이 μΌλ°˜μ μ΄μ§€λ§Œ 이 κΈ€μ—μ„œλŠ” μ‹€μˆ˜(real

darkpgmr.tistory.com

 

Reconstructing Lincoln

'School/COSE471 데이터과학' Related Articles +