Relevance in Machine Learning
- Linear transformations are used in both abstract mathematics, as well as computer science. Linear transformations within calculus are used as way of tracking change, also known as derivatives.
- Linear transformations are often used in machine learning applications. They are useful in the modeling of 2D and 3D animation, where an objects size and shape needs to be transformed from one viewing angle to the next.
- An object can be rotated and scaled withing a space using a type of linear transformation known as geometric transformations.
- Linear transformations also used to project the data from one spce to another. Sometimes, a dataset is not linearly seperable in its original space, therefore we need to transform (project) the data in another space with different dimensions. This can be done either using linear transformations or kernels.
Linear Transformations
- Let V and W be vectors spaces over a field F of dimensions n and m, respectively.
- A linear transformation is mapping such that:
Example
- such that
- such that
Remarks:
- A linear Map from T to itself is called a linear operator.
- A linear map from a vector space to underlying field is called a linear functional.
The Matrix Representation of a Linear Transformation
Suppose and are finite dimensional vector spaces with bases {v*{1}, v*{2}, …, v*{n}} and {w*{1}, w*{2}, …, w*{m}}, respectively. Let be a linear map. Then the matrix of T,with enteries , is defined by:
for j = 1,2,3,…,n.
It shows that the column of the matrix A of linear map T consists of the coordinates of in the chosen basis of W. Conversely, every matrix induced a linear map given by .
Example
- Consider a linear map such that .
- The matrix representation of T relative to basis . Solution: Gives, Hence,
Null Space and Range of a Linear Map
- Let be a linear map. The null space of T, is defined as and the range of T is defined as
Remarks:
- Nullspace of T is also called kernel of T denoted by .
- is a subspace of V.
- is a subspace of W.
- The dimension of is called the nullity of T, denoted by .
- The dimension of is called the rank of T, denoted by .
The Rank-Nullity Theorem
- For a linear map , the rank-nullity theorem states that
Example
- Determine the range and nullspace of the linear map defined by .
Solution:
Metric Spaces
- It is a generalization of the notion of distance from Euclidean space.
Definition:
- A metric on a set S is a function such that
- and
Example
- Take and define then forms a metric space.
Norm Spaces
- A norm on a real vector space V is a function such that
- and
- and
- A normed space is a pair where V is a vector space and is a norm on V.
Relation between Metric and Norm Spaces
- Every normed space is a metric space, but not every metric space is a normed space.
Example
- Let
Examples of some norms on
Convex functions
- A function is said to be convex if for all and , we have
Convex Sets
- A set is said to be convex, if the line joining any two points in the set lies entirely in the set.
Inner Product Spaces
- An inner product on a real vector space V is a function such that
- and
- and
- A vector space together with an inner product is called an inner product space.
Examples of Inner Products
-
The norm of a vector is the number of non-zero elements in the vector.
-
It is denoted by
-
It is not a norm in the mathematical sense, but it is used in the context of compressive/compressed sensing.
- In real finite dimensional vector spaces, any symmetric, compact, convex region centred at the origin is a norm.
Orthogonal Vectors
- In an inner product space , two vectors are said to be orthogonal if
Example
- Vectors and are orthogonal in with the inner product taken as usual dot product of vectors.
Orthogonal Complement
- If is an inner product space, then the orthogonal complement of W, denoted by , is the set of vectors in V that are orthogonal to every element of W:
Important Remarks:
- There is no requirement on W to be a subspace of V. However, if is always a subspace of V.
- If W is also a subspace of V, then Means, every vector can be uniquely written as where and .
Example
- In with inner product as usual dot product of vectors in , if we take then,
Orthogonal Projection
- The linear transformation is called the orthogonal projection onto W, where for any , we have where is an orthonormal basis of W.
Example
- Let and Take a vector
Properties:
- For any , .
- .
- .
- For any , .
- For any , . or
Progection
- Any linear map P that satisfies is called a projection, so is a projection.
Applications:
- Property 5 shows that orthogonal projection solves the minimization problem of finding the closest point in W to a given . This is quite usefull in ML where we need to find the closest vector in a subspace to a given vector in space.
Example
- Find the closest point to in Solution:
- Take and
Eigenvalues and Eigenvectors
Motivation:
Definition:
- Let , we say that a non-zero vector is an eigenvector of A corresponding to eigenvalue (a scalar) if
- The above relation tells that when the matrix (linear transformation) A applied on v, then it scales v by a amount .
How to find Eigenvalues and Eigenvectors:
-
(A - 3I)v = {0} \Rightarrow \begin{pmatrix} -1 & -2 & 3 \\ 1 & -2 & 1 \\ 1 & 3 & -4 \end{pmatrix} \dot \begin{pmatrix} v_{1} \\ v_{2} \\ v_{3} \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}
For , the eigenvector is (1,1,1).
-
For , the eigenvector is (1,-1,-1).
-
For , the eigenvector is (1,-1,1).

Properties:
- Trace(A) = Sum of Eigenvalues of A.
- Determinant(A) = Product of Eigenvalues of A.
Quadratic Forms
- Let be a symmetric matrix. The expression is called a quadratic form.
Example:
- Given Then for , we have Similarly if then associated matrix A to this quadratic form is given as
Rayleigh Quotient
- For a n x n real matrix A, we have
where
Furthermore, we have
- Scale invariance: For any and any scalar , we have
- If X is an eigenvector of A with eigenvalue , then
- For any X such that , we have This equality holds iff X is corresponding eigenvector.
- For any , we have
Positive Semi-Definite (PSD) matrices
- A symmetris matrix is said to be positive semi-definite if for all , we have
Properties:
- A symmetric matrix is positive (semi-) definite if and only if its all eigenvalues are positive (non-negative).
- A symmetric matrix is positive (semi-) definite if and only if all pivots are positive (non-negative).
Example
- Let then Hence, A is PSD matrix.
Positive Definite (PD) matrices
- A symmetric matrix is said to be positive definite if for all , we have
Example
Important Results:
- Suppose . Then is PSD. Moreover, if , then is PD.
- If A is PSD and , then is PD.
Example
The geometry of PD quadratic forms
- The isocontour of is an ellipsoids s.t. the axes points in the direction of the eigenvectors of A, and the radii of these axes are proportional to the inverse square root of the corresponding eigenvalues.

