r/learndatascience • u/UnemployedTechie2021 • Nov 02 '26
Resources Mathematics for Machine Learning shouldn't start with Linear Algebra.
I've been working on a tutorial on Mathematics for Machine Learning, and there's something I've been thinking about for a while.
Whenever people talk about the mathematics required for Machine Learning, the usual answer is:
- Linear Algebra
- Calculus
- Probability and Statistics
And they're absolutely right. These are fundamental to understanding how Machine Learning works.
But I think there's a problem with how we approach teaching these subjects.
Most resources assume you already have a reasonably good mathematical foundation.
They'll start explaining vectors, matrices, derivatives, gradients, probability distributions, and all sorts of other concepts. But what if you're someone who struggled with mathematics in school? What if you barely remember algebra? What if equations have always looked more intimidating than they should?
Where do you start?
I think we often overlook this group of learners.
Not everyone entering Machine Learning has a strong mathematical background. Some are developers who want to transition into ML. Some are students who discovered an interest in AI but aren't particularly confident in mathematics. Others simply want to understand what's happening behind the models rather than treating libraries as magic boxes.
And telling these people to just learn Linear Algebra, Calculus, and Statistics isn't particularly helpful if they don't have the foundations to understand them.
So I decided to approach this differently.
Instead of jumping straight into Linear Algebra, I've started building a Mathematics for Machine Learning tutorial from the ground up.
We're starting with algebra.
Yes, algebra. Variables, expressions, equations, exponents, logarithms, functions, graphs, and all those things that many of us probably haven't thought about since school.
From there, we'll gradually move towards:
- Algebra and mathematical foundations
- Functions and graphs
- Linear Algebra
- Calculus
- Probability and Statistics
- Optimization and Numerical Methods
The idea isn't to turn this into a school mathematics textbook or make people solve hundreds of equations without understanding why.
I want to focus on:
- Intuition first: Understand what a concept actually means before introducing complicated notation.
- Derivations: Understand where mathematical formulas come from instead of memorizing them.
- Worked examples: Break down problems step by step.
- Visual explanations: Use graphs and visualizations wherever they help.
- Python experiments: Connect mathematical concepts to actual code.
- Machine Learning applications: Understand where and why these concepts appear in ML algorithms.
Ultimately, I want someone to be able to look at a mathematical expression in a Machine Learning paper or an algorithm and understand what's happening, rather than immediately reaching for Google to find out what every symbol means.
I also want to be clear that this isn't going to be a shortcut. Mathematics takes time, and there's no getting around that. The goal is to make the journey less intimidating and more understandable.
I'm building this primarily for people who want to get into Machine Learning, Deep Learning, and eventually LLMs but feel that their mathematical background is holding them back.
I've started publishing the tutorial here:
https://mathsforml.vercel.app/
It's a work in progress, and I'll be expanding it as I develop more chapters and topics.
My philosophy is simple: You shouldn't have to be good at mathematics before you start learning it. You just need a place that teaches it properly, from where you are right now.
I'm curious to hear from others:
- Did you struggle with mathematics when you started learning Machine Learning?
- Do you think most ML mathematics resources assume too much prior knowledge?
- What concepts do you wish someone had explained properly before you started learning ML?
I'd also appreciate suggestions on topics that should be included in the tutorial. Feedback on the existing material is very welcome!
5
u/Stock_Test2326 Nov 02 '26
yep, i asked GPT that i dont know even high schools math and it gave almost same kind of syllabus to me.
3
u/Tiny_Spread5712 Nov 02 '26
I'd put statistics after functions and then linear algebra.
You can understand the basic concepts of machine learning with algebra and probability. that's where you develop the idea of algorithms and hueristics.
Then you can add the learning part with basic linear algebra, and then calculus for derivatives then linear algebra again, then calculus again.
Like if you aren't just sending people to libraries then you have to build the why from basic concepts and you can make code that will simulate a partial step with probability and algebra, and you can't really make that work with linear algebra and algebra without handwaving probabiliy
5
u/SprinklesFresh5693 Nov 02 '26
This is me basically, i come for a health science background and started doing modeling and programming in R, general linear models, linear mixed models, non-linear modeling and non-linear mixed modelling, but i lack linear algebra and calculus, and everytime i try to dive into understanding the complexity of modeling, every book assumes exactly what youre mentioned, they all assume you know matrix algebra, calculus, etc, and they dont spend much time, if any explaining it.
Heck i program in R, and many times i look for books about doing this modeling techniques in R and they dont spend much time explaining the theory behind the models, and those that do, keep the explanations too simple, or too complex using complex mathematical notation that is extremely hard for anyone that comes from a non-math background to understand.
5
u/Hopeful-Trainer-5479 Nov 04 '26
Op, am really not trying to be elitist in any way but maybe ML isnt for people that dont even clearly understand variables?
Saying this as someone that used to get 51% in high school math btw.
Forget about ML and build your foundations first. ML never was (and probably never will be) an entry level field
1
u/Surciol Nov 02 '26
I’ll for sure check this out, as I am exactly a person that you described. I was never a solid person in terms of math, I studied sociology and chose a social research specialization for masters. There was quite a bit of statistics and modelling - regression, PCA, clustering, a lot of scaling and latent variable modelling. I got hooked on it and naturally gravitated towards data science/ML. I feel like I have a very solid understanding of these basic methods - where and how to use them, how to read results. But implementing PCA from scratch would be tough for me, even though I completely understand the logic behind it. So I will give this a try, maybe you will help me to get past this math wall I am facing:p
3
u/cons_ssj 29d ago
Here is the thing. What you suggest is not mathematics for ML. It's general mathematics. Mathematics for ML is an advanced course to focus specifically on ML techniques and the math behind them. It's the same as saying that math for Quantum mechanics should start with what is a function and a variable. This is why in the universities there are required courses to take before you attend advanced courses.
If you start from zero coming from philosophy or other non mathemtatical fields, there is no shortcut. There is no "I just want to learn what's inside". You will need a few years to get some of the basics of calculus and statistics. Probabilistic statistics and inference could be a single course with Statistics as another prequisite course. Calculus could be a 3 term course (Calculus 1,2,3). Simply you cannot take the math in ML course if you haven't completed successfully the other courses.
Actually the book math in ML starts with the foundational building blocks of what you will need for the second part of the book, as it should be. Teaching vectors and calculus and probabilities is out of the scope of such a book.
In my opinion, you contradict yourself: you state that your philosophy is that someone don't need to be good in math to learn ML but on the other hand you say that this is not a shortcut and math take time. The reality is that there is no shortcut and teaching vectors and calculus is not "for ML and Deep Learning".
2
u/DigitalMonsoon Nov 03 '26
Yes, they generally assume you have completed Highschool mathematics.
2
u/Impressive_Jacket464 Nov 03 '26
I don’t understand your issue. If you know you lack the a foundation, why assume you can jump to an intermediate level? It’s obvious there are maths before linear algebra. You should have just gone back to grade school math as a review.
2
u/ford-imprefect Nov 04 '26
There is a term for these things "pre-requisites". Though i do agree we over emphasize LA. It's not really relevant day to day for most people working in the field.
2
u/Angel_Soars Nov 05 '26
Lmao
1
u/kelvinwop Nov 03 '26
algebra? abstract algebra or middle/elementary school algebra?
1
u/Prof_Paul_Nussbaum Nov 03 '26
See my book “Applications of Reading the Robot Mind.” It has some chapters on explaining AI to youngsters, and includes a game you can play.
1
u/Ancientsloth_334 Nov 04 '26
Nice initiative keep up the good work.
1
u/APett Nov 04 '26
I would add visual representations of these. Part of the problem with math learning is that just chucking equations at a visual learner isn't particularly helpful. This book is a really good example of that: https://www.goodreads.com/book/show/61739368-make
1
u/wacoder Nov 05 '26
Started coding as a teenager in the early eighties, have had an entire almost 40 year career as a self-taught SE, from startups to fortune 200s. I only have a HS level math education. Perfect for me, thank you!
1
u/PencilBoy99 Nov 05 '26
nice
0
u/[deleted] Nov 02 '26
[deleted] — view deleted comment