How to Learn Math for Machine Learning: Step by Step Guide?

How to Learn Math for Machine Learning

When it comes to learning math for machine learning, most of us are stuck and don’t know what to learn and from where to learn…Right?. That’s why I thought to write an article on this topic. In this article, I’ll discuss how to learn math for machine learning step by step. So read this article and clear your all confusion regarding math for machine learning.

So, without further ado, let’s get started-

How to Learn Math for Machine Learning?

Before learning math, you should know why math is important for machine learning and why you can’t avoid math. Alright…?. So let’s understand the importance of math in Machine Learning-

Importance of Math in Machine Learning

  • With the help of mathematics, you can select the right algorithm which includes giving considerations to accuracy, training time, model complexity, number of parameters, and number of features.
  • Mathematics helps you to identify under-fitting and over-fitting by understanding the Bias-Variance tradeoff.
  • You can choose parameter settings and validation strategies with the help of math.
  • Without knowledge of math, you can’t estimate the right confidence interval and uncertainty.

That’s why you should have mathematics knowledge to become a Data Scientist or Machine Learning Engineer.

Now you understood the importance of math, so let’s see how to learn math for machine learning and what’s the first step-

Step 1- Identify How Much Math is Needed for Machine Learning

The first step is identifying how much math is required for machine learning. So the minimum level of mathematics needed to be a Machine Learning Scientist/Data Scientist is-

  1. Linear Algebra
  2. Probability Theory and Statistics
  3. Multivariate Calculus
  4. Optimization Methods

1. Linear Algebra

Before discussing what topics to learn in Linear Algebra, I would like to tell you why you need to learn Linear Algebra for Machine Learning.

Why Linear Algebra?

In machine learning, most of the time we deal with scalars and vectors, and matrices. For example in logistic regression, we do vector-matrix multiplication. Sometimes we do clustering of input by using spectral clustering techniques, and for this, we need to know eigenvalues and eigenvectors.

Linear algebra is used in data preprocessing, data transformation, dimensionality reduction, and model evaluation.

I hope, now you understood why you need to learn Linear Algebra…Right?. Now let’s see what topics you need to learn in Linear Algebra-

Topics to Learn in Linear Algebra-
  • Basic properties of a matrix and vectors: scalar multiplication, linear transformation, transpose, conjugate, rank, and determinant.
  • Inner and outer products, matrix multiplication rule and various algorithms, and matrix inverse.
  • Matrix factorization concept/LU decomposition, Gaussian/Gauss-Jordan elimination, solving Ax=b linear system of an equation.
  • Eigenvalues, eigenvectors, diagonalization, and singular value decomposition.
  • Special matrices: square matrix, identity matrix, triangular matrix, the idea about sparse and dense matrix, unit vectors, symmetric matrix, Hermitian, skew-Hermitian and unitary matrices.
  • Vector space, basis, span, orthogonality, orthonormality, and linear least square.

2. Probability & Statistics

So let’s understand why probability and statistics is important in machine learning-

Why Probability & Statistics?

Probability helps you to manage uncertainty. Uncertainty means working with imperfect or incomplete information. And in Machine Learning, we build predictive models from uncertain data. But we can manage uncertainty using the tools of probability.

Whereas Statistics help you to count well, normalize well, obtain distributions, find out the mean of your input feature, and its standard deviation.

That’s why knowledge of Probability and Statistics is important for machine learning. Now let’s see what topics you need to learn in Statistics & Probability-

Topics to Learn in Probability & Statistics
  1. Mean
  2. Median
  3. Mode
  4. Standard deviation/variance
  5. Correlation coefficient and the covariance matrix
  6. Probability distributions (Binomial, Poisson, Normal)
  7. ANOVA, t-test
  8. Hypothesis testing
  9. Confidence intervals
  10. p-value
  11. Baye’s Theorem (Precision, Recall, Positive Predictive Value, Negative Predictive Value, Confusion Matrix, ROC Curve)
  12. A/B Testing
  13. Monte Carlo Simulation

3. Multivariate Calculus

So as we did in the previous two sections, let’s also understand the importance of multivariate calculus in machine learning-

Why Multivariate Calculus?

Multivariate Calculus helps us to explain the relationships between input and output variables. And Multivariate Calculus comes into the picture when you deal with a lot of features and huge data. That’s why familiarity with multivariate calculus is essential for building a machine learning model.

Now let’s see what topics you need to learn in Multivariate Calculus

Topics to Learn in Multivariate Calculus

  • Functions of several variables,
  • Derivatives and gradients,
  • Step function,
  • Sigmoid function,
  • Logit function,
  • ReLU (Rectified Linear Unit) function,
  • Cost function,
  • Plotting of functions,
  • Minimum and Maximum values of a function.

4. Optimization Methods

Optimization methods are important to understand the computational efficiency and scalability of our Machine Learning Algorithm. In the end, mostly all Machine learning algorithms come down to some optimization tasks.

Topics to learn in Optimization
  1. Cost function/Objective function
  2. Likelihood function
  3. Error function
  4. Gradient Descent Algorithm and its variants (e.g. Stochastic Gradient Descent Algorithm)

So now you understood how much math you need to learn. Now, the next step is-

Step 2- Find Out the Resources to Learn Math for Machine Learning

Once you identified the topics, the next step is to find some valuable resources for learning math. Thanks to the Internet Era, there are lots of resources available online. You can learn math from YouTube videos, online tutorials, and courses.

I am going to tell you some best resources for learning math-

Resources for Learning Linear Algebra-

  1. Linear Algebra Refresher Course– FREE Course
  2. Linear algebra (Wikipedia)
  3. Introduction to Linear Algebra, Fifth Edition (TextBook)
  4. Mathematics for Machine Learning: Linear Algebra (Online Course)
  5. Linear Algebra at Khan Academy
  6. First Steps in Linear Algebra for Machine Learning (Online Course)
  7. Linear Algebra for Beginners (YouTube Video)

I hope these resources are enough for you to learn Linear Algebra.

Resources for Learning Probability Theory and Statistics

For Probability-

For Statistics-

Resources for Learning Multivariate Calculus

Resources for Learning Optimization Methods-

Step 3- Make a Plan for Learning

Now you understood how much math is needed, and got resources for learning, the next step is to make a learning plan. This means identifying how to learn all the required math for machine learning.

I would not suggest learning math first without learning ML Algorithms. Why…?

Because without having familiarity with ML algorithms, you can’t relate math terms with machine learning. So first gain some fundamental knowledge of machine learning algorithms, and then learn math.

Suppose you are learning Logistic Regression, and you realize that Linear Algebra is required for understanding logistic regression. So then you can go with these listed resources and learn linear algebra concepts.

So what will happen if you learn in this manner. You can easily relate the math terms with machine learning algorithms.

But if you start your ML journey with math, you will feel frustrated after some time, especially if you are from a software background like I am😃.

So if you are a complete beginner in ML and planning to start your journey in ML, I would recommend starting with Machine Learning Course by Andrew Ng. This course will provide you a basic understanding of ML algorithms. Once you will gain a basic understanding of Machine learning algorithms, then learn math.

I hope now you understood everything related to math for machine learning. Now it’s time to wrap up.

Conclusion

In this article, I tried to explain how much math is needed for machine learning, resources for learning math, and how to learn math without losing enthusiasm. If you have any doubts or questions, feel free to ask me in the comment section.

All the Best!

Enjoy Learning!

Thank YOU!

Learn Machine Learning A to Z Basics

Subscribe For More Updates!

[mc4wp_form id=”28437″]

Though of the Day…

Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young.

– Henry Ford
author image

Written By Aqsa Zafar

Founder of MLTUT, Machine Learning Ph.D. scholar at Dayananda Sagar University. Research on social media depression detection. Create tutorials on ML and data science for diverse applications. Passionate about sharing knowledge through website and social media.

Leave a Comment

Your email address will not be published. Required fields are marked *