A preparatory guide on Machine Learning.

A gentle introduction to ML

So, the industry right now is exploding, right? There’s Deep Learning and Machine Learning skills are becoming ever more important and opening up whole new plots. Machine learning and AI is no longer just a technical thing limited to the software industry it’s becoming prominent in every industry in a steady manner.

With Deep Learning, Machine Learning one of the best tools you can use to implement these algorithms is TensorFlow.

Learning algorithms can be quite complicated, and today, programming frameworks like TensorFlow, PyTorch, Caffe and many others can save you a lot of time in coding and debugging volumes of codes.


Coding has been the fuel for many brains since the rise of the computers. We have been building applications by decomposing problems with optimal solutions that can then be coded against. Say for example if we’re writing a snake game we usually figure out rules, if snake swallows the object then the object should vanish and again new object should appear for the snake to swallow. But if the snake hits the walls then the player loses their life. We can represent with this diagram

In conventional programming, Rules and Data are fed Results will be generated. Rules and data go in Results come out. Rules are expressed in a programming language i.e., syntax and data range from a text file all the way up to video file it may be any data.

Machine learning makes our lives easier by flipping the axes. In machine learning algorithm Results and Data are fed and Rules will be generated.

So, instead of us as developers figuring out the rules when should the snake swallow, when should the player’s life end, what we will do is, we can get a bunch of examples for what we want to see and then have the computer figure out the rules. Now, this is particularly valuable for problems that you can’t solve by figuring the rules out for yourself.

Consider this example, Impact app; https://impactapp.in/ you raise money by walking or jogging or exercising/running and money goes to various charitable causes… an app that detects if somebody is say walking and we have data about their speed, we might write code like this

 if(velocity<4)
 {
 activity=walking;
  }

And if they’re moving well that’s a faster speed so we could adapt to code to this.

if(velocity<4)
{
activity=walking;
 }
else
{
activity=jogging;
}

If they’re running, well that’s not too bad either we can code like this.

if(velocity<4)
{
 activity=walking;
 }  
else if(velocity<15)
{
 activity=jogging;
  } 
  else 
  {
   activity=running;
  }

We walk and run at different speeds but what if a person runs like “Usian Bolt” 27.7380 miles per hour. Now, these concepts become broken, Impact app may assumes he is on a running vehicle but actually he is a speedster. Not only that if we consider only speed is quite not sufficient to estimate status but also results may not be accurate. Ultimately machine learning is very similar to this so, instead of trying to express the problem as rules when often that is impossible, we have to compromise. So, what we have to do is get lots and lots of examples and label and use this data to say this is what walking looks like, this is what jogging looks like, this is what running looks like. So, then it becomes Results and Data in with Rules being inferred by the machine as shown in fig 2.

Machine learning is all about a computer learning the patterns that distinguish things. Like for Impact app, it was the pattern of walking, jogging and running that can be learned from various sensors on a device. We will tell a computer what the data represents (i.e. this data is for walking, this data is for running), this process is called Labelling data. Computer distinguishes these activities as walking, jogging, running. These metrics may vary but this is the basic idea behind the devices.

Walking
Computer distinguishes this activity as walking.
Jogging
Computer recognises this activity as jogging.

A machine learning algorithm then figures out the specific patterns in each set of data that determines the distinctiveness of each.

Labelling follows the same for running as well.

This activity is inferred as running by the computer.

“Machine Learning represents a new paradigm in programming, where instead of programming explicit rules in a language such as C or C++, you build a system which is trained on data to infer the rules itself”.

With this programming paradigm we can just do any old thing in a new feasible way. Neural Network which is the pillar of doing this type of pattern recognition. A Neural Network is slightly more advanced implementation of machine learning and we call that as Deep Learning. So far we have learned what Machine Learning is how computer recognises patters to discriminate things and how it will label data to identify things.