Linear Algebra(1) - Vector/Matrix
2021. 1. 30. 10:24ㆍ[AI]/Data Science Fundamentals
<Learned Stuff>
Key points
-
Vector/Matrix
-
matrix : 기본적으로 2D array 를 사용해야 됨 (대괄호가 바깥에 하나 더 있다고 생각하자)
-
concept
- transpose
- identity
- diagonal
- upper/lower
- inverse
- dot product
- magnitude
- determinant
-
<New Stuff>
[transpose] $a^T$
# a 라는 np.array가 있다고 가정
a.T
# ==> returns transpose of 'a'
[Identity] $I$
np.identity(n)
# ==> returns n by n identity matrix
[inverse] $a^{-1}$
# a 라는 np.array가 있다고 가정
np.linalg.inv(a)
# ==> returns inverse of a matrix 'a'
[dot product] $a{\cdot}b$
# a 라는 np.array가 있다고 가정
# b 라는 np.array가 있다고 가정
np.dot(a,b)
# ==> returns dot product of 'a' and 'b'
[magnitude] $||a||$
# a 라는 np.array가 있다고 가정
np.sqrt(np.dot(a.T,a)) # transpose 해줘야함
# ==> returns magnitude of 'a'
# or 함수 쓰기
np.linalg.norm(a)
# ==> returns magnitude of 'a'
[determinant] $|a|$
if determinant is 0 : SINGULAR!
# a 라는 np.array가 있다고 가정
np.linalg.det(a)
# ==> returns determinant of 'a'
728x90
'[AI] > Data Science Fundamentals' 카테고리의 다른 글
Statistic(4) - Bayesian (0) | 2021.01.30 |
---|---|
[Statistic (Summary)] T-test & $\chi^2$-test (0) | 2021.01.30 |
Linear Algebra(2) - Span/Basis/Linear Projection (0) | 2021.01.30 |
Linear Algebra(3) - Dimension Reduction (0) | 2021.01.30 |
Linear Algebra(4) - Clustering (0) | 2021.01.30 |