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.

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.


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

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.

Download our Mobile App

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.

Support independent technology journalism

Get exclusive, premium content, ads-free experience & more

Rs. 299/month

Subscribe now for a 7-day free trial

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.

AIM Upcoming Events

Early Bird Passes expire on 3rd Feb

Conference, in-person (Bangalore)
Rising 2023 | Women in Tech Conference
16-17th Mar, 2023

Conference, in-person (Bangalore)
Data Engineering Summit (DES) 2023
27-28th Apr, 2023

3 Ways to Join our Community

Telegram group

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

Discord Server

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

Subscribe to our Daily newsletter

Get our daily awesome stories & videos in your inbox

All you need to know about Graph Embeddings

Embeddings can be the subgroups of a group, similarly, in graph theory embedding of a graph can be considered as a representation of a graph on a surface, where points of that surface are made up of vertices and arcs are made up of edges