We map the column of the vector onto each row of the matrix, multiplying each element and summing the result.
The result is a vector. The vector must be the second term of the multiplication. The number of columns of the matrix must equal the number of rows of the vector.
An m x n matrix multiplied by an n x 1 vector results in an m x 1 vector.
Efficient way of doing a large number of predictions for a given hypothesis function:
We multiply two matrices by breaking it into several vector multiplications and concatenating the result.
An m x n matrix multiplied by an n x o matrix results in an m x o matrix. In the above example, a 3 x 2 matrix times a 2 x 2 matrix resulted in a 3 x 2 matrix.
To multiply two matrices, the number of columns of the first matrix must equal the number of rows of the second matrix.
Efficient way of doing a large number of predictions for more than one competing hypothesis functions:
Matrix Multiplication Properties
- Matrices are not commutative:
- Matrices are associative: