The Essentials of Machine Learning

Learn the difference between conventional programming and machine learning, the types of machine learning, and some of its applications.

From rules to data

Before directly jumping into machine learning, let’s figure out why we need it. A conventional program takes some inputs and produces output(s) based on a set of instructions or rules. For instance, the program of sorting an array of real numbers consists of a set of instructions (rules) that produces a sorted array output.

Note: The rules (sorting program) produce the data (sorted array).

This typical way of programming that uses a fixed set of rules won’t scale for many pattern identification problems.

From data to rules

Consider an example of identifying a human face. There’s a plethora of parameters that can describe a human face, including the width, shape, and height of the nose, color and depth of the eyes, gender of the person, type and color of facial hair, etc. It isn’t scalable to write a set of rules that correspond to each of these parameters. We can’t practically address so many combinations while programming conventionally. In contrast, a typical way of addressing this problem is to dynamically learn the rules (program) from the data (face images) itself. Therefore, machine learning comes to the rescue in all those scenarios where typical programming to define problem-specific rules might be impossible.

What is machine learning?

Machine learning, also known as learning from data, involves training algorithms to recognize patterns and make data-based decisions. According to Arthur Samuel, machine learning is the “field of study that gives computers the ability to learn without being explicitly programmed.”

Types of machine learning

Data is the fuel for machine learning to grasp generalizable patterns. The data requirements depend on the problem at hand. For instance, we require several face images and their corresponding identities (labels) as data to build a facial recognition system. After acquiring the data, the goal is to learn a mapping from face images to the corresponding labels. The label is said to have supervisionIt refers to the presence of labeled data that enables a machine learning model to learn and improve its accuracy. characteristics. ML can be divided into different types based on the data and the problem. We can categorize ML into three significant categories:

  • Supervised learning
  • Unsupervised learning
  • Reinforcement learning

Supervised learning

While all machine learning algorithms utilize data, supervised learning is considered the most data-intensive category.

A supervised learning algorithm takes labeled data as input and uses it to train a model that can make predictions or inferences on new, unlabeled data. A model is a mathematical representation of the relationship between the input features and the target class. The input features (independent) refer to the quantifiable attributes that describe the data, such as weight, height, and color, while the target class (dependent) is the desired output, such as identifying spam or non-spam emails. Hence, the main job of this type of algorithm is to find the relation between input features and their respective target class so that the trained model can predict the label of the unseen data in the future.

Supervised learning

There are two main types of supervised machine learning: regression and classification.

  • Regression is the type of supervised learning where the goal is to predict a continuous output variable. For example, when predicting the price of a house, the input might be the features of a house, such as the number of bedrooms and bathrooms, and the output will be the price of the house.

  • Classification is a type of supervised learning that aims to predict a categorical label for each input. For example, in fruit classification, the input is a fruit, and the output is a label indicating whether the fruit is an apple or a mango.

Unsupervised learning

Unsupervised learning deals with grouping the data based on some similarity/dissimilarity. Unlike supervised learning, it extracts patterns from the given data without labels. In other words, this technique distinguishes possible clusters in the data based on some similarity matrices. As labels aren’t required for this method, it requires minimal human intervention. In some scenarios where we have labeled data along with unlabeled data, the model training will be called semi-supervised learning.

Unsupervised learning

Reinforcement learning

In reinforcement learning, an agent learns to take actions in an environment to maximize a reward signal. It isn’t fully supervised, as labels for individual decisions aren’t available in the data. However, it isn’t fully unsupervised either, as the delayed labelsThis refers to the feedback on the outcomes of an action. It’s not immediately available but can be accessed later to guide the learning process. are available. The true decision is not available in reinforcement learning, but the consequences can be accessed later. This is similar to how we teach a cat to perform tricks by rewarding it for the correct behavior. Consider chess as an example. At the beginning of the game, we can only consider a move to be the best if it eventually leads to winning. However, at the time of making the move, we won’t know if it would lead to winning. This example isn’t fully supervised as the labels for individual decisions are not available in the data. However, it isn’t fully unsupervised either, as the delayed labels are available.

Applications of machine learning

Computer vision

In computer vision, ML is used for recognizing and tracking objects and analyzing videos with the help of visual dataImages and videos.

In the case of object detection, ML models take an image as input and output the objects surrounded by a bounding box, as shown below:

Natural language processing

Before jumping into natural language processing (NLP), let’s explore its need. To translate a sentence, we need to be aware of its context because if we just translate the sentence word by word using any dictionary, it might not make sense. Therefore, a program that can understand and interpret human language has been a long-standing need. Any program that tackles the complexity of language translation performs NLP in actuality. One of the most popular ML applications of NLP is Google Translate. It’s used by many people around the world every day and enables them to communicate with each other across borders or cultures.

Language translation
Language translation