The Math Skills that make Machine Learning easy (and how you can learn it)

Math for our world
17 followers
So, I've been a data scientist for around 10 years and I've taught machine learning to many cohorts
and bootcamps in different countries, so I've seen hundreds of students with different backgrounds
struggle or excel at machine learning and data science. And I believe this one skill has more
influence on what camp you will fall into than any other. The good news is that I think you can
learn this skill regardless of your background, but of course it will be easier for some than for
others. In this video I will try to show you how exactly to go about acquiring the skill,
no matter your background, to make you a much better data scientist or machine learning engineer.
Some of the bootcamps I taught at had fairly different syllabuses, so I was able to see what
types of skills ended up producing better data scientists. What I would see often is that people
memorize machine learning algorithms and learn how to use tools like scikit-learn and get really
amazing accuracies in their projects, but then get total nonsense when trying to apply what they
learned to the real world. The reason is that students will blindly use the tools without
having a good intuition on what the algorithms are meant for and how they work. So they end up
overfitting to their training data, which makes the algorithm completely fall apart when feeding
it real world data. They don't understand why some models work for some problems but not others.
That's why the one skill that will make machine learning insanely easy for you
is mathematical intuition for certain concepts, in particular from statistics. This doesn't mean
that you need to know all of math or be a math genius to become a good data scientist, although
that would surely help. It means truly understanding the core mathematical concepts that most machine
learning algorithms are built on instead of memorizing them. I will now give you a list of
mathematical concepts that I consider to be essential for becoming a great data scientist
or machine learning engineer, including what I consider to be the single most important concept
in machine learning. I believe if you truly understand this concept, you will be better
at machine learning than 95% of your peers. At the end of the video, I will share my favorite
resources that I use to learn the most important math concepts for machine learning, completely for
free. The most important mathematical branches for machine learning in my opinion are in order
of importance statistics and probability, linear algebra, in particular if you want to get into
neural networks, calculus, a few special concepts from machine learning. I believe that statistics
is the most important branch because having a really good grasp on statistics will instantly
make you 10 times better at machine learning and save you a ton of time by not picking the
wrong algorithms for your problem. This does not mean that you need to know all of statistics, but
that you get a good understanding and intuition for some core principles and ideas. While I always
loved math, I actually used to hate statistics. But the good news is that when learning machine
learning, I got over my fear of statistics and once this happened, my understanding of machine
learning exploded. At the end of the video, I will share the free online resource I use to get over
my fear of statistics. Statistical intuition will help you pick the right algorithm for the right
problem and the data at hand. Accuracy isn't all that matters. Many problems can be solved with
simple algorithms if you have a good intuition for what's needed. That will not only save you lots of
time, but also make your model much more interpretable and the insights much more actionable,
which in a business setting is sometimes the most important thing, and it will make your model much
more generalizable and work better on unseen data. Additionally, if you truly understand the math
behind your algorithms, you will have a very good understanding of what your hyperparameters do
for each algorithm, which will help you fine-tune your model much more quickly than blindly searching
the entire hyperparameter space, which again can lead to overfitting if you don't have enough data
to cross-validate your hyperparameter search. And yes, you can tune too much, which will be obvious
when your understanding of statistics improves. I do understand why math isn't taught more in many
bootcamps. It's because it takes time and bootcamps are short, and they want you to get started with
the tools quickly, sometimes to the detriment of your understanding. So usually it will be up to
you to learn on your own, but it will be worth it, I promise. Before I share the list of concepts, I
want to share a little trick with you. I want you to think about math a bit differently. Instead of
just memorizing equations and formulas, try to understand what the formulas are trying to do.
Very commonly, math or machine learning teachers will simply throw an equation on the screen and
tell you, for example, this is the loss function for this algorithm, and simply expect you to accept it.
Instead of just accepting the formula, I would try to ask myself, what is the point of this formula?
What is it trying to do? You can even write it out in natural language. A good example might
be linear regression. You're trying to find the line that best represents some data points.
What does best even mean? In linear regression, best means that the points are as close to the line
as possible. So if you try out different lines, what is the best line? One metric could be the
vertical distance of the points to the line. How do we measure that? We could simply subtract the
true value of y of a data point from the predicted value of y, which is the y value of the line at
same value of x for that data point. In this case, y is the salary of a person, either actually
measured by the data point or predicted by the regression line, and x is the experience of a
person, for example in years. But if we want the distance from the line, truly we don't want
negative values, we just want the distance. So we can just square the difference to make it always
positive. What if we want to do that for all points? We sum up all the squares of the differences.
That leads us to our formula. We are trying to minimize the sum of squared residuals,
also called residual sum of squares or RSS. It's not about memorizing formulas, but trying to
understand the purpose of the formula. There's often more than one way to solve a problem.
This approach will also give you an intuition on what the different hyperparameters in different
models stand for and thus help you fine-tune your models much better and pick the right model for
the right problem. Mathematical formulas just help us communicate our goals with the computer.
Minimizing the RSS is just the mathematical way of saying,
I want the line to be close to the points, which allows us to put that into a computer program.
Almost all formulas you might come across were thought up by a human trying to put an idea like
that into formal mathematical language, which can be understood by a computer.
Here my list of topics and concepts. Probability and statistics. Random variables. Probability
distributions. Different types of plots for data and distributions and their interpretation.
Populations and samples. And the law of large numbers. The mean, the median, and expected
values, variance, and covariance. Correlation. The central limit theorem. And the normal
distribution. The standard deviation, statistical significance, z-scores, and hypothesis testing.
Specificity, sensitivity, and confusion matrices. The multiple comparisons problem and solutions,
for example, Bonferroni correction. Conditional probability and Bayes theorem. Linear algebra.
Vectors and matrices. Matrix operations. Addition, subtraction, multiplication,
inverse, transpose. Matrix rank and linear independence. Calculation and meaning of
basic trigonometric terms, like vector norms, cosine, and sine. Calculus, derivatives,
and their meaning. Basic rules like the chain rule. Machine learning. Specific concepts. Lost
functions. Gradient descent. Regularization. Truly understand the meaning of train, test,
validation, set. Here your statistical intuition will help a lot. Truly and fully understand at
least linear regression. Labels, weights, parameters, hyperparameters. Validation and
cross-validation. Overfitting and underfitting. In my opinion, the single most important concept
in machine learning. Truly understand bias and variance and the bias-variance trade-off.
Your intuition here will be formed mostly by a deep intuition about statistics and statistical
significance. The size and quality of your data set. Proper model selection and so on. This is
truly at the core of being a good data scientist. If you want me to make a video on any specific
topic from this list, please let me know in the comments. Also let me know if I forgot anything
important. Here are the free resources I used to learn these skills from scratch. I will also leave
links in the description. Khan Academy has amazing and very beginner-friendly content on statistics,
linear algebra and calculus. Completely for free. I would start here. I will leave links in the
description for machine learning specific topics. I then read the book An Introduction to Statistical
Learning. Also available for free on the website of the authors, who also made an amazing video
series based on the book, which is also available for free on YouTube. I will leave links to both
in the description as well. The YouTube channel 3 Blue1Brown has amazing videos on some specific
topics with truly incredible visuals that help you understand some of the more complicated concepts
of math and machine learning. Like the central limit theorem, neural networks, calculus and
probability distributions. In my opinion the single best math education content available on the
internet. If you want to now dive into the most important machine learning algorithms or get a
roadmap to how to learn machine learning, check out my videos on that on this channel. I will also
leave links in the description. If you found this video helpful, share it with someone who you think
might also like it and get started on one of the tutorials in the description or on this very
channel. Also consider liking the video and subscribing to be notified about similar content
in the future. Thanks for watching!
