Machine learning and data science are rapidly growing fields. Based on several industrial surveys, job opportunities in roles such as data analyst, data scientist, machine learning engineer, etc. are increasing day by day. On the other side, companies are collecting data in one form or another to improve customer experiences and understand their operations better.
For example, a vehicle company collects data about how their vehicle performs on the road. Similarly, a milk farming company collects data on their sale and analyses when their firm needs an extra amount of milk to serve their customers better. In this blog, we will begin our career-focused journey in machine learning by exploring its fundamental concepts.
The brain is the most complex part of the human body, and researchers are still uncovering its workings. To better understand the brain, let's consider a simple example. Imagine a ball is coming towards us. What would be our first reaction? Most likely, we will use our hands to catch the ball.
Behind the scene, this can be translated into input and output. Our eyes sense the incoming ball and send input signals to our brains. The brain receives these signals, analyzes them, and generates the output reaction of moving our hands to catch the ball.
In biological terms, brain cells have perceptrons or receivers known as dendrites that receive electrical signals as input data from our sensory organs such as the eyes, nose, skin, etc. The brain cells analyze these signals and respond by releasing reaction signals through axon terminals as output data.
In our childhood, we may have struggled with catching balls. However, through practice, our brains eventually learned how to do so. In this process, the brain effectively learns the mapping function from inputs to outputs. In other words, the process of learning a mapping function through repeated experiences is referred to as intelligence in living beings. Now the critical question is: What if some non-living things started doing the same? Can we develop the same capability for our computers? That's where the concept of "Machine Learning" comes into play.
We saw that human brains have a unique characteristic of learning from different experiences and evolving to do their best for similar experiences. Continuing the same example of catching the ball, suppose we want to make a Robot catch the ball. How can we do that? There are two possible solutions.
We can write a computer program that uses a function-based approach to catch a ball. The program will take ball location as input and output the position where robot should be placed to catch it. This is the idea of traditional programming.
Let's understand this from another perspective. Suppose our robot is nothing but just a tiny computer. In this case, we can represent the traditional programming process using a block diagram. We input the ball position as input data and then the computer executes the program and outputs the corresponding robot position. For example, let's simulate this using multiple if-else conditions.
if ball position is X1:
place robot at Y1
elif ball position is X2:
place robot at Y2
elif ball position is X3:
place robot at Y3
So on....
Suppose we have recorded data for ball positions and corresponding robot positions, (X1, Y1), (X2, Y2), (X3, Y3), ..., (Xn, Yn), where X is the ball position and Y is the robot position to catch the ball. Now we ask our robot to predict its possible position for the recorded ball positions one after the other. For example, if we asked the robot to predict its position when the ball is at X1, the robot initially made incorrect guesses and the difference between its guess (Y1') and the actual position (Y1) was significant.
Now our robot learned from its mistakes and continually corrected its predictions for each recorded ball position (X1, X2, …, Xn). Through this process, it eventually achieved intelligence level and started predicting correct or nearly correct position (Y1', Y2', …, Yn'). This type of computer intelligence obtained from learning through various recorded experiences is known as Machine Learning.
Once the learning process is complete, our robot can predict position for new and unseen ball positions, such as Xn+1. It will provide an output, Yn+1', and the success of its prediction can be measured by whether the ball is caught or not.
From another perspective, we provide our computer historical experiences in the form of ball position as input data and corresponding robot position as output data. The computer then learns how to convert the input data into the output data. In this process, it discovers the program that we had to explicitly write in traditional programming. Isn't that fascinating?
Once the computer has learned this program, it can perform similar functionality as traditional programming for any new ball position, even if we don't know the corresponding robot position. It takes the new ball position as input data and uses the learned program to calculate the corresponding robot position. This is what Machine Learning is all about.
Traditional programming is about writing code to explicitly defines how the computer should perform a task. The programmer must specify the rules for the computer to follow, and computer will execute those rules regardless of any changes in the data. This approach works good for simple and well-defined tasks.
In contrast, Machine learning is a way for the computer to learn how to perform a task without being explicitly programmed. Instead of specifying the rules, the programmer trains the computer on data, allowing it to analyze the data and find patterns. Now computer uses these patterns to make predictions or decisions without the need for additional programming. In other words, the programmer provides the computer with a set of past experience in terms of data, and the computer uses algorithms to learn from those experiences.
Before moving forward, let's define "Machine learning" formally.
Did you notice the similarity between these two definitions? In Machine Learning, the computer learns from historical data instead of writing programs or functions. That's why both definitions include the phrase "without explicit programming."
The computer takes input data and output data as parameters and tries to find the best suitable function that maps the input data to the output data. Similar to working of brain, the machine learns this mapping function using existing experiences.
Why do we need Machine Learning if we already have traditional programming, which allows us to write thousands of lines of code? For example, consider the ball-catching robot example. What if we use if/else conditions to cover all the cases of robot positions? Why use Machine Learning then? The answer is simple: the positions that a robot can take are limited, which can only be in a defined arena where we carry out the task of catching the ball. But covering all scenarios using if/else conditions would be challenging.
Consider coding a self-driving car on the road. Is it possible for someone to cover all cases using traditional programming? No, the possibilities of scenarios are infinite. That's where Machine Learning comes in. It can learn automatically for different scenarios and improve its experience based on new experiences.
Handwritten character recognition: There are billions of people out there, and two persons' handwriting barely matches. If we opt for traditional programming to identify the characters in handwritten documents, we might never cover all the cases.
Email Spam/Non-spam classification: Based on the content of the email, we classify whether that is spam or non-spam. Every professional person in the world daily gets around 150 emails on average. Suppose we traditionally programmed our computer that if an email contains these sets of words/links/phrases, then mark it as spam. Don't you think spammers will quickly get the hint that their emails are marked as spam when they are sending these sets? They will easily find an alternative, and now we have to program our computer again for those alternatives.
Face Recognition: All computer vision tasks involve billions of image pixels (one unit of image). We can not explicitly write programs to perform functions on various pixels.
If we have to define the technology application term Automation, we could say that human involvement is minimised. We generally take the help of machines by programming them. So if a computer program is automation, then Machine Learning is automating the automation process.
Enjoy learning, Enjoy algorithms!