As a branch of mathematics, linear algebra is widely used in science and engineering, so mastering the linear algebra is necessary for understanding and working on machine learning algorithms. Therefore, this book first explores some of the necessary linear algebra knowledge. Learning linear algebra involves the following kinds of mathematical concepts: 8.1.1 scalars (scalar)
A scalar is a single number, which differs from most of the other objects studied in linear algebra (usually many arrays of numbers). We represent scalars in italics. Scalars are usually given lowercase variable names. When we introduce scalars, we make clear what type of numbers they are. For example, when defining a real scalar, we might say, "Make S∈r s∈\mathbb R represents the slope of a line"; When defining a natural number scalar, we might say "make N∈n n∈\mathbb N represents the number of elements". 8.1.2 vectors (vector)
A vector is a number of columns. These numbers are arranged in an orderly manner. Through the index in the order, we can determine each individual number. Usually we give the lowercase variable name of the vector bold, such as X x. The elements in the vector can be represented by a italicized body with a foot tag. The first element of the vector x x is X1 x_1, the second element is X2 x_2, and so on. We will also indicate what type of element is stored in the vector. If each element belongs to R \MATHBB R, and the vector has n n elements, then the vector belongs to the set of N-N times Cartesian products of the real set R \MATHBB R, which is recorded as Rn \mathbb r^n. When we need to explicitly represent the elements in the vector, we will arrange the elements in a column surrounded by a square bracket:
⎡⎣⎢⎢⎢x1x2⋯xn⎤⎦⎥⎥⎥ (8.1) \begin{bmatrix} x_1 \ x_2 \ \cdots \\x_n \end{bmatrix}\qquad\qquad\qquad\qquad (8.1)
We can think of vectors as points in space, with each element having coordinates on a different axis.
Sometimes we need to index some elements in the vector. In this case, we define a collection that contains the index of these elements, and then write the collection at the foot mark. For example, specify X1 x_1, x3 x_3 and X6 X_6, we define set s={1,3,6} s=\{1,3,6\}, and then write XS x_s. We use the symbolic −-to represent the index of the collection's complement. For example, X−1 x_{-1} represents X