Day01 Basic Mathematics Review (1)
Scalar, Norm, Matrix (Inverse, Basic Functions), Rank
One of my previous courses: Machine Learning Statistics Review
ML Stat Review
Scalar
- An element of a field which is used to define a vector space
Vector
-
A mathematical object that has both a magnitude and direction
-
Two vectors are the same, if they have - the same magnitude & direction - if they are the same, their cosine similarity is 1
Matrix
- A matrix is an array of numbers sized โm by nโ. - m = #rows, n = #columns
Norm
Matrix Operations
-
Unit vector: a vector of length 1, also called normalized vector
-
How do we convert a vector into a unit vector?
-
- Dot product (inner product) of vectors
- Multiply corresponding entries of two vectors and add up the result โ> useful for a proxy for the angle between two vectors (Ex. If B is a unit vector, then A*B gives the length of A which lies in the direction of B)
-
- Product of two matrices
- matrix multiplication is associative & distributive & not commutative
-
- Transpose: A matrix flipped over its diagonal
- Useful for Rotation, Scaling, and Data Manipulation.
Determinant
- Can only be calculated for square matrices
- Useful: The area of an n-dimensional parallelogram is the determinant
Matrix Inverse
- When the determinant is zero, a matrix is not invertible.
-
- How useful?
- We can multiply a matrix by its inverse.
Pseudoinverse ์ ์ฌ์ญํ๋ ฌ (Explained by Korean)
- If you want to use an inversed Matrix even though it is not a Square Matrix (Square Matrix๊ฐ ์๋ ๊ฒฝ์ฐ์๋ ์ญํ๋ ฌ์ ์ฌ์ฉํ๊ณ ์ถ์ ๊ฒฝ์ฐ)
- Generalized inverse or Moore-Penrose inverse (ํน์ด๊ฐ ๋ถํด(Single Value Decomposition svd)๋ฅผ ์ด์ฉํ๋ฉด ๋ฌด์ด-ํ๋ก์ฆ ์ ์ฌ ์ญํ๋ ฌ์ ์ฝ๊ฒ ๊ณ์ฐํ ์ ์๋ค)
- Use:
- Compute a โbest fitโ solution to a system of linear equations.
- Find the minimum norm solution to a system of linear equations.
- Matrix is non-invertible: matrices are sparse( have many zero) / very large / very small.
Linear (in)dependence
- Linear independence: No vector is a linear combination of the other vectors
- Common cause: One of the vectors is a null vector , Or the vectors are perpendicular to each other
Matrix Rank
- The maximum number of linearly independent column vectors
- ๐ถ๐๐ โ ๐๐๐๐ ๐ด = ๐ ๐๐ค โ ๐๐๐๐(๐ด) (always!)
- Rank tells the dimension of an output (when you want to transform a matrix)
- If a square matrix (m x m) is rank m, we say itโs โfull rank.โ
- If rank < m, we say itโs โsingular.โ
- At least one dimension is a linear combination of another dimension
- There is no inverse
Leave a comment