Introduction to Machine Learning 😷

Subscribe to my newsletter and never miss my upcoming articles

In the previous section, we have seen the basic introduction of deep learning, artificial intelligence, and their application in real life as well as industrial.

We have also seen the difference between ML, AI, and Deep Learning and a small explanation of their subfield i.e. Supervised and Unsupervised Learning.

What is Machine Learning

So let's start with a problem, Suppose you were given the following input and output values.

Screenshot from 2020-11-25 21-18-15.png

So when you input a value of zero you get an output value of 32 and when you input a value of eight, you get an output value of 46.4, and so on.

Take a closer look at these numbers and let me ask you a question, can you figure out what will be the output value if you put in 38 as the input value? 🤔️

Screenshot from 2020-11-25 21-47-47.png

If you answered 100.4, then you are correct. So how we solve this problem?

Well, If you look closely at the inputs and outputs, you will realize that they are related via the equation. 😯️

Screenshot from 2020-11-25 21-48-33.png


  • input refers to degrees in Celsius and is represented by the letter C,
  • and the output refers to degrees Fahrenheit represented here by the letter F.

What just happen

For example, an input value of zero refers to a temperature of zero degrees Celsius, which corresponds to 32 degrees Fahrenheit.

We get 32 by multiplying zero by 1.8 and adding 32 as we see in this equation.

Similarly, an input value of 15 refers to a temperature of 15 degrees Celsius which corresponds to 59 degrees Fahrenheit.

We get 59 by multiplying 15 by 1.8 and adding 32 as we see in this equation.

What your brain 🧠️ just did to figure out the relation between these particular inputs and outputs, that's exactly what machine learning does.

That is, given a set of inputs and their corresponding outputs, the machine-learning algorithms will figure out the correct algorithm to convert the inputs to the outputs.

Traditional Development vs Machine Learning

Screenshot from 2020-11-25 21-49-29.png

How it works

The machine learning approach consists of using a neural network 🗄️ to learn the relationship between these inputs and outputs.

You can think of a neural network as a stack of layers where each layer consists of some predefined Math and internal variables.

The input value is fed to the neural network and follows through the stack of layers. The Math and the internal variables are applied to it and the resulting output is produced.

Screenshot from 2020-11-25 21-50-55.png

In order for the neural network to learn the correct relationship 👬️ between the inputs and the outputs, we have to train it.

We train our neural network by repeatedly letting the network try to map the input to the output. While training, tuning the internal variables in the layers until the network learns to produce the output given the inputs.

Screenshot from 2020-11-25 21-51-38.png

As we will see, the training process to teach the network to tune its internal variables is performed for thousands or even millions of iterations ➿️ over the input and the output data.

In very simple terms,

You can think of the machine learning algorithm as a function that can tune variables in order to correctly map some inputs to some outputs.

Enough theory, let's see how this can be done in code. 😍️

No Comments Yet