Role of Mathematics in Machine Learning
Nowadays many people are planning the transition to AI/ML/Data Science world which is very encouraging and matching the pace of changing the world.
But these people are confused with questions like :
- I wanna be ML specialist without diving deep into mathematics, is it possible?
- Why is mathematics important in data science and AI/ML world?
- As mentioned, a vast array of libraries exist to perform various machine learning tasks so it’s easy to avoid the mathematical part of the field.
If you think of these questions too, this article is for you.
Various problems are hard to solve using traditional programming methods like computer games, self-driven cars, recognizing objects. One way round is to tell computers how to learn from data, this is machine learning.
Machine Learning helps Amazon suggest products for you, Youtube recommend videos, classify spam mail, etc. To make this possible, we combine mathematics with lots of programming.
Machine Learning is all about creating algorithms that can learn data to make a prediction. Machine Learning is built on mathematical prerequisites.
Mathematics is important for solving the Data Science project, Deep Learning use cases. Mathematics defines the underlying concept behind the algorithms and tells which one is better and why.
Well, you can create models without even knowing the maths behind the working of algorithms but wait… How would you know which one is better and where to use it?
Let me clear the air. You need to understand the mathematics behind machine learning algorithms to become a data scientist. There is no way around it. It is a fundamental part of a data scientist’s role and every recruiter and experienced machine learning professional will vouch for this.
Machine Learning is structured on the foundation of these four pillars of Mathematics:
- Linear Algebra
- Calculus
- Statistics
- Probability
Linear Algebra: It makes possible for algorithms to run on massive datasets.
- Linear algebra shows up everywhere in the machine learning world
- Without linear algebra, machine learning methods cannot be developed, a complex data structure cannot be handled and manipulated, matrix operations on large datasets are not possible
- Linear Algebra concepts one needs to know — Vectors, Vector Spaces, Scalars, Orthonormalization, Matrix Operations, Projections, Eigenvalues & Eigenvectors, etc.
Linear algebra acts as a stage or a platform over which all the machine learning algorithms display their results.
But why linear algebra?
Linear algebra can transform datasets into matrices on which several operations can be performed. NumPy is such a library used in Machine Learning which performs several operations on N-d array.
Calculus: It is used to finetune the result. It optimizes the performance of the algorithm.
- Calculus plays an integral role in many machine learning algorithms like in the gradient descent algorithm and backpropagation to train deep learning neural networks.
- Calculus knowledge helps in the optimization of the model’s performance.
- Calculus concepts one needs to know — Differential and Integral Calculus, Partial Derivatives, Vector-Values Functions, Directional Gradient, Jacobian, etc.
In Machine Learning, we try to find the inputs which enable a function to best match the data. The slope or descent describes the rate of change off the output with respect to an input. Determining the influence of each input on the output is also one of the critical tasks. All this requires a solid understanding of Multivariate Calculus.
For example:
Linear Regression is a linear model that establishes the relationship between a dependent variable y(Target) and one or more independent variables denoted X(Inputs) using a best fit straight line (also known as a regression line).
This algorithm shows how calculus is used in finding slope, gradient descent and working behind this algorithm.
Probability: It helps in predicting the likelihood of future events in machine learning.
- The main sources of uncertain events which introduce imperfection in machine learning models are noisy and scarcity of relevant data.
- Probability concepts that one needs to know — Joint, Marginal, and Conditional Probability, Probability Distributions (Discrete, Continuous), Density Estimation, Maximum Likelihood Estimation, Regression with Maximum Likelihood, Bayes Theorem, etc. We use them to carry out hypothesis testing where an understanding of probability is quite essential.
The Naive Bayes algorithm is an example that works on a similar principle, with a simple assumption that all the input features are independent.
Statistics: Statistics can be used to draw logical conclusions from the given data.
- Statistics is a collection of tools that helps to identify the goal from the available data and information.
- Statistics helps to understand the data insights and transform the sample observations into meaningful information.
- No system in the world has perfect data stored and readily available as needed. Every system has data anomalies like incomplete, corrupted data, etc. Statistical concepts will be your best friend to help in such complex situations.
- It helps to answer questions such as :
1. What product was so sold highest at any particular month?
2. Who scored the most runs in cricket tournament? - Statistical concepts that one needs to know — Distribution, Central Tendency, Skewness, Linear Correlation Coefficient, Central Limit Theorem, Hypothesis Testing, etc.
Statistics is the most commonly used part of Machine Learning algorithms. A Data Analyst’s job role is to draw conclusions/questions from the given data and he/she is dependent on statistics for it.
Conclusion
Mathematics for machine learning is an essential facet that is often overlooked or approached with the wrong perspective.
As a soft prerequisite, there is an expectation that one should have a fair understanding of these mathematical concepts.
This doesn’t mean you have to go through your high school notes and mug up the theorems. The best way to get a taste of mathematics is to take an ML algorithm, find a use case, solve and understand the maths behind it.
When one encounters real-world problems in machine learning, it becomes easy to resolve them if he/she has good understanding and intuitions of mathematical concepts. It enhances critical problem-solving skills too.