coursera week 1 - matrices
and vectors
1. Matrix Elements
A = \begin{bmatrix} 1 & 2 \\\ 4 & 5 \\\ 7 & 8 \end{bmatrix} \tag{fmt.1 R^{32}}
$ A_{ij} = $ " entry" in the row, column
$ A_{32} = 8 $
2. Vector n*1 matrix
y = \begin{bmatrix} 460 \\\ 232 \\\ 315 \\\ 178 \end{bmatrix} \tag{fmt.2}
4 dimensional vector
2.1 math 1-indexed
y = \begin{bmatrix} y1 \\\ y2 \\\ y3 \\\ y4 \end{bmatrix} \tag{fmt.3}
2.2 machine-learning 0-indexed
y = \begin{bmatrix} y0 \\\ y1 \\\ y2 \\\ y3 \end{bmatrix} \tag{fmt.4}
3. Matrix Addition
\begin{bmatrix} 1 & 0 \\\ 2 & 5 \\\ 3 & 1 \end{bmatrix} + \begin{bmatrix} 4 & 0.5 \\\ 2 & 5 \\\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 5 & 0.5 \\\ 4 & 10 \\\ 3 & 2 \end{bmatrix}
4. Scalar Multiplication
3 \times \begin{bmatrix} 1 & 0 \\\ 2 & 5 \\\ 3 & 1 \end{bmatrix} = \begin{bmatrix} 3 & 0 \\\ 6 & 15 \\\ 9 & 3 \end{bmatrix}
5. Combination of Operands
3 \times \begin{bmatrix} 1 \\\ 4 \\\ 2 \end{bmatrix} + \begin{bmatrix} 0 \\\ 0 \\\ 5 \end{bmatrix} - \begin{bmatrix} 3 \\\ 0 \\\ 2 \end{bmatrix} / 3 = \begin{bmatrix} 2 \\\ 12 \\\ 31/3 \end{bmatrix}
6. Matrix Vector Multiplication
Matrix Vector Multiplication Fmt :
6.1 House sizes example
House sizes | Price |
---|---|
2104 | ? |
1416 | ? |
1534 | ? |
852 | ? |
\begin{bmatrix} 1 & 2104 \\\ 1 & 1416 \\\ 1 & 1534 \\\ 1 & 852 \end{bmatrix} \times \begin{bmatrix} -40 \\\ 0.25 \end{bmatrix} = \begin{bmatrix} -40 \times 1 + 0.25 \times 2104 \\\ ... \\\ ... \\\ ... \end{bmatrix}
7. Practice Example
\begin{bmatrix} 1 & 3 & 2 \\\ 4 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 3 \\\ 0 & 1 \\\ 5 & 2 \end{bmatrix} = \begin{bmatrix} 11 & 10 \\\ 9 & 14 \end{bmatrix}
$ A_{2 \times 3} \times A_{3 \times 2} = A_{2 \times 2} $
8. House Example
9. Matrix
But, 结合律,可以的
$ A \times B \times C = (A \times B) \times C = A \times (B \times C) $
10. Identity Matrix
Denoted I (or I_{n*n}).
10.1
\begin{bmatrix} 1 & 0 \\\ 0 & 1 \end{bmatrix} \tag{fmt.1 R^{32}}
10.2
\begin{bmatrix} 1 & 0 & 0 \\\ 0 & 1 & 0 \\\ 0 & 0 & 1 \end{bmatrix} \tag{fmt.1 R^{32}}
11. Matrix Inverse
Not all numbers have an inverse.
if is an matrix, and if it has an inverse
A = \begin{bmatrix} 3 & 4 \\\ 2 & 16 \\\ \end{bmatrix}
A^{-1} = \begin{bmatrix} 0.4 & -0.1 \\\ -0.05 & 0.075 \\\ \end{bmatrix}
$ A \times A^{-1} = I_{2 \times 2} $
I\_{2 \times 2} = \begin{bmatrix} 1 & 0 \\\ 0 & 1 \\\ \end{bmatrix}
12. Matrix Transpose
A = \begin{bmatrix} 1 & 2 & 0 \\\ 3 & 5 & 9 \\\ \end{bmatrix}
A^T = \begin{bmatrix} 1 & 3 \\\ 2 & 5 \\\ 0 & 9 \end{bmatrix}
Let be an matrix, and let .
Then is an matrix, and
Coursera Week 2 - Linear Regression with Multiple Variables
coursera week 2 - linear regression with multiple variables 1 1. Multiple Features \begin{ali...
Coursera Week 1 - Linear Regression Cost Function & Gradient descent
Linear Regression Cost Function & Gradient descent 1. Linear Regression 2. Cost Function ...
Checking if Disqus is accessible...