r/learnmachinelearning • • 16d ago • Bravo 2

How much math do I actually need before starting Machine Learning?

After 3 years of working as a freelance Node.js developer, I've decided to switch to Machine Learning. I mostly worked on smaller projects, but the growing use of AI in web development has made me lose interest in the field. I want to move into something more challenging that requires a deeper understanding of math and fundamental concepts.

For the past month, I've been studying linear algebra and calculus pretty intensively (5–6 hours a day).

Here's my dilemma: I want to understand ML from the ground up, not just use libraries without knowing what's happening under the hood. But I also don't want to spend an entire year studying math before touching ML**.**

Which math topics are truly essential, and in what order should I learn them to build a solid, connected understanding rather than just memorizing isolated concepts?

I'd really appreciate some guidance. Honestly, spending 5–6 hours a day studying math is easier for me than figuring out exactly what I should focus on.

72 Upvotes

24 comments sorted by

9

u/Ccrystal4216 16d ago

honestly a month of 5-6 hrs/day is already more math than most people shipping ML ever did lol. you’re good to start

what you actually need is matmul and shapes, chain rule, basic probability and MLE (that’s why MSE/cross-entropy are the losses), and gradient descent. eigen/SVD can wait till you hit PCA

coding each piece in numpy the same week you learn it. linear regression, logistic regression with hand-derived gradients, then a 2-layer MLP with manual backprop. once your gradients match a numerical check you understand more than half the people importing torch

spent 1.5 yrs at a research lab and the math I actually used day to day was way smaller than people think

1

u/d1zzdev 13d ago

Thank you so much! I honestly didn’t expect to get advice from such experienced professionals. 1.5 years working in a lab sounds really impressive!

43

u/Random_Arabic 16d ago • Bravo Heartwarming

Here are some resources I'd recommend. I've found these books particularly useful because they approach machine learning from different perspectives.

1. Mathematical foundations

Mathematics for Machine Learning – Garrett Thomas (UC Berkeley)

A nice, concise overview of the mathematical foundations you'll need: linear algebra, calculus, optimization, and probability. I'd use it as a roadmap to organize your math studies.

2. An Introduction to Statistical Learning (ISLR/ISLP)

This would probably be my first recommendation for learning ML concepts. Despite having an applied focus, the book does a great job of explaining the statistical ideas behind the methods. You don't necessarily need to focus on the programming labs; I'd recommend reading the theoretical chapters and using the book to become familiar with the main statistical learning concepts.

There's also a YouTube lecture series taught by the authors themselves.

3. The Elements of Statistical Learning

PDF – The Elements of Statistical Learning

Once you feel comfortable with the concepts and have a stronger background in algebra and statistics, I'd recommend this one. It's a classic in the field and goes much deeper into the mathematical and statistical foundations behind ML methods.

4. Probabilistic Machine Learning

If you're looking for something more modern, I'd also recommend Kevin Murphy's books:

These take a more theoretical and probabilistic approach to machine learning. They require a stronger mathematical and statistical background, so I'd save them for later. The accompanying Python notebooks are also useful if you want to experiment with the concepts.

5. Deep Learning

Deep Learning: Foundations and Concepts – Bishop & Bishop

Another excellent resource if you eventually want to dive deeper into deep learning, particularly its mathematical foundations and more recent developments.

You definitely don't need to read all of these, though. I'd start with the mathematical foundations and ISLR, and then choose where to go deeper depending on your interests.

5

u/SwimQueasy3610 16d ago

Great list, thanks for sharing!

Another option for mathematical foundations would be Math for Machine Learning, by Deisenroth Faisal and Ong. I just took a quick glance at Thomas (that you linked) and looks like solid lecture notes, I think Deisenroth et al may be a little more comprehensive.

3

u/Datscie_249 16d ago

thanks for sharing, too!!!

3

u/ClubAdministrative95 16d ago

Good links! I will use them as well! Thnks!

2

u/Linux_Net_Nerd89 16d ago

On this now thank you.

2

u/Datscie_249 16d ago

thanks, man!

4

u/tora_0515 16d ago

Calculus at bare minimum and you'll struggle with all concepts.

Add linear algebra and you will understand a lot more

A calc based probability class will open more

Statistics (not business stats) will get you even more understanding as ML is just statistics on a computer.

Get to partial derivatives and you'll be set pretty well.

But even here you could keep going with things like Brownian motion, markove chains, beyesian inferences, etc...

More is better here. But functional calc, linear algebra, and a rigours stats class will get you a long way.

4

u/Future_Pace_5290 16d ago

Depends on what type of ML.

For Neural Networks specifically and Deep Learning:

You only need:

1- Multivariate Calculus to understand Gradient Descent, and Backprop.

You only need to understand partial derivatives, directional derivatives, and how the gradient relates to that. for Gradient Descent.

And for backprop, you only need to understand the multivariate chain rule.

You don't need to know any integration, or the derivative of specific functions(other than very basic stuff like x^2).

2-From Linear Algebra, you only need to understand what a Matrix is, how to multiply two matrices, what a transpose is.

These are enough to understand how a Neural Network works.

2

u/Sea_Acanthaceae9388 16d ago

There’s just as much genAI usage in Machine Leanring

2

u/heresyforfunnprofit 16d ago

The more you have the better, but all you need is to understand derivatives. Beyond that, it’s all linear algebra.

1

u/Pupeliene_Travolta 15d ago

Id say start learning ML alongside the math, you dont need to know everything beforehand, a lot of things become clearer once you put them into practice..

1

u/PhoenixAlive87 15d ago

One way to avoid getting stuck in endless preparation is to treat maths and ML as two connected learning tracks.

For each concept, try asking yourself: Can I explain what it represents, why the operation is needed, and what the result means?

For example, with a dot product, don't stop at knowing how to calculate it. Try understanding what the score tells you, what it doesn't, and how changing the inputs affects it.

Once that clicks, apply it in a small ML example. You can return to the deeper derivations as needed.

You don't have to finish all the maths before beginning ML, but you don't have to rush past the meaning either.

0

u/CryptographerFun5985 16d ago

I'd suggest not spending an entire year studying mathematics before starting ML. In fact, I'd recommend learning math alongside ML concepts rather than treating them as two separate subjects.

Since you already have a programming background, you can start exploring ML while building your mathematical understanding.

Here's the order I'd recommend:

  1. Linear Algebra: Vectors, matrices, dot products, matrix multiplication, eigenvalues, and eigenvectors. Connect these to linear regression, PCA, and how data is represented in ML.
  2. Calculus: Derivatives, partial derivatives, gradients, and the chain rule. Understand these through gradient descent, optimization, and backpropagation.
  3. Probability & Statistics: Distributions, conditional probability, Bayes' theorem, expectation, variance, and hypothesis testing. These become particularly useful when understanding model predictions, uncertainty, and evaluation.
  4. Optimization: Loss functions, gradient descent, learning rates, and regularization. Learn these while actually training models.

One mistake I'd strongly recommend avoiding is studying mathematics in isolation for months without applying it to ML.

For example, instead of spending weeks solving matrix problems without context, learn how matrix operations are used in linear regression. Similarly, understanding derivatives becomes much more interesting when you see how gradient descent actually uses them to minimize a loss function.

This approach helps you understand not just the mathematics, but WHY you need it.

A little about me: I have a Master's in Artificial Intelligence from IIT Kharagpur and currently work as an AI Scientist. I've also been teaching and mentoring AI/ML learners for several years.

I'm actually planning a Math for AI/ML series on my YouTube channel, where I'll teach mathematical concepts by directly connecting them to ML algorithms and applications, rather than teaching mathematics as an isolated subject.

You can follow it here: https://www.youtube.com/@AIMLwithAkash

My advice would be to start building simple ML models now. Whenever you encounter mathematics you don't understand, study that concept, connect it to the algorithm, and continue. You don't need to master all the math before writing your first ML model.

1

u/d1zzdev 13d ago

Thank you so much! I really appreciate hearing from people with your level of experience

0

u/sunil_indialabs_ai 15d ago

I have created a full course on youtube (however it is in Hindi/Hinglish) covering all the essential math topics needed for AI/ML in an ordered manner. I will be happy if this helps you in any way --> https://www.youtube.com/playlist?list=PLOMnAHYhdcKM