Identity Matrix

What is an Identity Matrix?

An identity matrix, also known as a unit matrix, is a square matrix in which all of the elements of the principle diagonal are ones, and the rest are zeros. Because an identity matrix is a square matrix, its number of rows matches its number of columns. When multiplying a given matrix with an identity matrix, the values remain the same. In short, the identity matrix functions in the same way that the number 1 does within a real number system.

Image provided by statisticlectures.com

Identity Matrices and Machine Learning

Identity matrices exist within a subset of machine learning known as linear algebra. In short, linear algebra offers a way of understanding the specific functions of an algorithm, allowing you to make better decisions. Data is represented by linear equations that are typically presented in the form of matrices and vectors.


Imagine a photo or image, within the context of computer vision applications. Each image has a defined width, height, and a pixel value (black or white). In the case of color photos, there are three pixel values (RGB). All of this information can be represented by a table structure, with a pixel value in each cell. Any changes made to the image, such as scaling, cropping, or shearing all can be described using the notation and operations of linear algebra. In short, it provides a mathematically quantifiable way of defining changes to an object.