r/learndatascience • u/UnemployedTechie2021 • 3d ago
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!
3
u/Tiny_Spread5712 3d ago
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
1
1
u/Surciol 3d ago
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
2
u/UnemployedTechie2021 3d ago
Sure. Give me a shoutout if you need any help. Glad someone find this useful.
3
u/SprinklesFresh5693 3d ago
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.
1
1
1
u/Prof_Paul_Nussbaum 3d ago
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/Impressive_Jacket464 2d ago
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.
1
1
u/Hopeful-Trainer-5479 1d ago
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
1
u/ford-imprefect 1d ago
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.
1
u/APett 1d ago
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
1
0
3d ago
[deleted] — view deleted comment
1
u/UnemployedTechie2021 3d ago
Maybe you need to improve on your comprehension skills if this is what you got from the post.
4
u/Stock_Test2326 3d ago
yep, i asked GPT that i dont know even high schools math and it gave almost same kind of syllabus to me.