Why You Should First Learn Linear Algebra Before You Ace Machine Learning


Just like a solid foundation is essential to a building, linear algebra forms an essential learning segment for machine learning (ML). Areas of mathematics such as statistics and calculus require prior knowledge of linear algebra, which will help you understand ML in depth. Many ML experts may be of the opinion that linear algebra (LA) helps to some extent, but it definitely improves one’s math skills and intuition in ML.

This article presents the top five reasons to help you get acquainted with the preliminaries of LA.


Sign up for your weekly dose of what's up in emerging technology.

What is Linear Algebra?

Linear Algebra is a branch of mathematics that deals with linear equations and linear functions which are represented through matrices and vectors. In simpler words, LA helps you understand geometric terms such as planes, in higher dimensions, and perform mathematical operations on them. By definition, algebra deals primarily with scalars (one-dimensional entities), but LA has vectors and matrices (entities which possess two or more dimensional components) to deal with linear equations and functions. LA can also be called as the extended version of algebra.

1.  LA Is The Elementary Unit For ML

Calculus precedes LA when it comes to learning advanced math. Differential Calculus and Integral Calculus help you not just with limits, differentiation and integration techniques, but also set a base to apply them to vectors and multi-dimensional configurations such as tensors. This is called Matrix Calculus. Knowing this will help your understanding in areas such as linear functions and systems of linear equations. This is in addition to advanced topics such as Vectors in space and the Simplex method. In fact, the latter will also help you with linear programming. All of these concepts will be a cakewalk if you dedicate your time to learning LA and ML.

2. The ML Intuition

LA will boost your intuition towards ML by offering more perspectives. The vectors and matrices you come across in LA will make your thinking more broad and idealistic. You may be motivated to utilise more parameters to a ML component, use more matrix operations, visualise and come up with different plotting graphs, or even apply a unique and better code. The possibilities are numerous. For example, consider a ML project in healthcare. The use cases here can be preventive care, diagnostics, insurance and patient health history, among others. Even though the datasets are available, the approach to building a ML model depends on perspectives such as data exploration, training and test data, regression and graphical depictions, among other features.

3. LA Helps Build Better ML Algorithms From Scratch

LA will certainly assist in developing popular ML algorithms primarily categorised as Supervised Learning and Unsupervised Learning from scratch. Decision trees, linear regression, logistic regression, support vector machines and ensemble methods fall under supervised learning algorithms. On the other hand, clustering, component analysis and single value decomposition (SVD) fall under unsupervised learning algorithms. LA will facilitate a deeper understanding for the ML project which provides the flexibility to customise any parameters involved. This is really helpful as it will lead to optimal usage of resources.

4. LA Will Improve One’s Take On Statistics

For ML, statistics forms a vital part to organise and assimilate data. LA acts as a prerequisite to have a solid understanding of statistical concepts. Notations, methods and operations in LA will assist in assimilating advanced topics in statistics such as multivariate analysis. For example, let us consider a doctor who has patient data such as blood pressure, heart rate, height, weight, among other data. These will form the multiple variables in the data set. Let us assume that more weight leads to higher blood pressure. This forms a linear relation — the increase in one variable leads to the increase in other.

Suppose, if you want to perform a multivariate regression analysis in a statistical software such as  Stata, you will use manova and mvreg commands. The manova command ensures that the equations are statistically compatible; while the mvreg command obtains parameters such as standard errors among other estimation parameters. Therefore, the statistical result obtained is interpreted as a linear function and transformed into a matrix later for further work in ML.

5. LA For Processing Graphics In ML

A ML project usually deals with objects such as audio, video and images along with other graphical interpretations such as edge detection. ML algorithms use classifiers to select some part of the dataset to train them according to a particular category. The classifiers also try to obviate errors from trained data. This is where LA comes into picture. It serves as an engine to compute these large, complex data.

It incorporates a specific matrix decomposition technique for the project to handle and process the data. For example, two popular methods known as L-U decomposition and Q-R decomposition are used for the same. L-U method is used to split a square matrix into two matrices called as upper-triangle matrix and lower-triangle matrix. These sub-matrices are obtained by importing NumPy library for Python (depends on the programming language used), and loading the code in the compiler. On the other hand, Q-R decomposition is used for matrices which are of the order n x m (non-square matrix). This process will simplify the graphical need and uses optimal resource to generate the graphical model.

Conclusion :

For a ML beginner, LA might be a bit overwhelming to learn since ML itself has an array of concepts to master. Concepts such as linear functions and system of linear equations may look puzzling to some. But with regular practice and effort, LA will no longer be a daunting task. The benefits of learning LA are multi-fold. It improves math skills, programming skills and prepares the learner to think and explore the broader side of ML.

More Great AIM Stories

Abhishek Sharma
I research and cover latest happenings in data science. My fervent interests are in latest technology and humor/comedy (an odd combination!). When I'm not busy reading on these subjects, you'll find me watching movies or playing badminton.

Our Upcoming Events

Masterclass, Virtual
How to achieve real-time AI inference on your CPU
7th Jul

Masterclass, Virtual
How to power applications for the data-driven economy
20th Jul

Conference, in-person (Bangalore)
Cypher 2022
21-23rd Sep

Conference, Virtual
Deep Learning DevCon 2022
29th Oct

3 Ways to Join our Community

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Telegram Channel

Discover special offers, top stories, upcoming events, and more.

Subscribe to our newsletter

Get the latest updates from AIM

What can SEBI learn from casinos?

It is said that casino AI technology comes with superior risk management systems compared to traditional data analytics that regulators are currently using.