Role of Mathematics in Machine Learning

Ritik Verma
CampusX
Published in
5 min readMar 13, 2020
An image showing some random mathematical calculation

Mathematics is all around us, in everything we do. It is the building block for everything in our daily lives, including mobile devices, architecture (ancient and modern), art, money, engineering, and even sports. Machine Learning is also no exception to it. Machine learning algorithms build a mathematical model based on sample data, in order to make predictions or decisions without being explicitly programmed to perform the task.

Basically, there are four branches of mathematics which are heavily used in machine learning which we will be discussing in this article:

  1. Linear Algebra
  2. Calculus
  3. Statistics
  4. Probability

Linear Algebra:

An image showing some random linear algebra calculations.
Linear Algebra Calculations

Linear algebra works as the heart of machine learning algorithms. Linear algebra concepts provide the underlying data structure used in machine learning. Vectors, Matrices are two fundamental data structure used to store and represent data. The ease of performing operations on these data structures is the reason behind the popularity of them.

Example:-

Images and Photographs: The images are stored in a computer with the help of 3 matrices of red, green and blue. Each matrix has a dimension equal to the resolution of the image. They contain information about each pixel i.e how much red, green or blue should be there at each pixel.

One Hot Encoding: The categorical data is stored in vector form with one-hot encoding i.e give each category value and represent it wherever the data is.

Calculus:

An image showing some random mathematical calculus calculation.
Calculus Calculations

Concepts of calculus are used in machine learning for optimization of algorithms. As 100% accuracy of the model is not possible to attain, we need a method to optimize our result as much as we can. Some uses of calculus in machine learning are:-

  • Gradient computations: Gradient computations are generally fed into numerical optimization algorithms and calculus is readily used to compute these, especially in the case of neural networks where we use the chain rule to arrive at the Backpropagation Algorithm.
  • Numerical Optimization: This is used to train models, given a dataset, that will be used to perform anything from inference to data generation to sequential decision making.

Statistics:

An image showing some random statistical charts.
Statistical Charts

Statistics is the branch of mathematics where we collect and analyse a large chunk of data. The concepts of statistics are widely used in every phase of Machine Learning, right from data collection to algorithm structuring. Different modelling techniques of statistics are used in data collection and forming the sample population. Statistic concepts are also used in analyzing the type of data whether linear or continuous or discrete etc. Basically, there are two branches of statistics:-

(1) Descriptive: Also known as summary statistics, we analyse given chunk of data like mean, sd, etc. For example, performing analysis of employees of a company.

(2) Inferential: All the times working on the entire population is not possible so we make sample population from the entire population and perform analysis and inference that it is true for the entire class of the population. The sample must be Random (i.e candidates must be randomly selected without any bias) and Representative (i.e every class of population must be covered). For example analysis on people of India.

Probability:

Probability

Probability is the bedrock of machine learning. Machine learning is about developing predictive models from uncertain data. Uncertainty means working with imperfect or incomplete information. This uncertainty can be managed using tools of probability. Some examples of probability concepts used in machine learning are:

  • Classification models must predict a probability of class membership
  • Algorithms are designed using probability (e.g. Naive Bayes)
  • Learning algorithms will make decisions using probability (e.g. information gain)
  • Sub-fields of study are built on probability (e.g. Bayesian networks).

Importance of types of data in machine learning

Classification of Data

In machine learning, we deal with the various category of data ranging from string to numeric to float. We need to identify data kind before-hand for the application of an algorithm for performance and optimization of algorithm. The types of data we will be dealing in machine learning are:-

(1) Numerical Data (Quantitive Data):

Quantitative data are measures of values or counts and are expressed as numbers. Quantitative data are data about numeric variables (e.g. how many; how much; or how often). Some real-life examples of Quantitive data are: the price of Smart Phone, Salary of employees, Wealth of person, etc.

Types of numerical data

There are two types of Quantitive Data:-

  • Continuous Data: Continuous data can attain any value in a graph. It can be either numeric or float. Example of continuous data: Price of the smartphone, the weight of a person.
  • Discrete Data: In Discrete Data, can attain specific value. It can only be numeric or float at a time. Example: Number of apps installed on the smartphone (Cannot be decimal), age of the person.

(2) Categorical Data (Qualitative Data):

Qualitative data are measures of ‘types’ and may be represented by a name, symbol, or a number code. Qualitative data are data about categorical variables (e.g. what type). Example: Beauty of girl, Brand of Smartphone, etc.

Example of Qualitative Data

There are two types of Categorial Data:-

  • Nominal Data: Where there is no specific order between categories it is known as nominal data. Example: In gender data, both male and female have equal value.
  • Ordinal Data: When there’s a specific order between data it is known as ordinal data. Example: Bad, Good, Average for the mobile battery.

Hence from the above article, we can conclude that the essence of mathematics is present everywhere in Data Science and Machine Learning right from data collection to algorithm modelling.

--

--