Inner and outer products of vectors
As we have said, vectors are the natural way to store data points that have many features. You probably already have some experience with manipulating vectors or arrays, for example, by performing element-wise calculations on them. But we want to do more than that. We want to combine vectors. This section introduces the two most basic but important operations we can apply to two vectors – the inner product and the outer product.
Inner product of two vectors
To calculate the inner product between two vectors, and , they need to be of equal length. In this and all subsequent calculations, we will assume that our vectors and are real-valued. If those vectors are -dimensional and have components and , then the inner product between them is denoted by the symbol and is defined as follows:
Eq. 1
Because of the dot between and in the left-hand side of Eq. 1, the inner product is also called the dot-product of and . The result...