Understand Machine Learning with Examples

Introduction

Ever since computers have been created, we are progressively trying to make them advanced and powerful. From the room-sized machines to the gadgets in our pockets, And are now designing artificial intelligence to automate every task that would need human intelligence. Machine Learning is a subset of Artificial Intelligence. Computers, software and devices perform by experience likewise the way the human brain does.

The possibility is that Artificial Intelligence is omnipresent and we may not know about it. Machine learning plays a key role in tagging people on Facebook or Instagram. Furthermore, it also recommends the next video to watch on YouTube or NetFlix. Every time we use Google Search, we are using a system that has many machine learning systems at its core, from understanding the text of our query to further adjusting the results based on our personal interests.

Definition of Machine Learning

Machine Learning is all about tools and technology that certainly uses data to answer our questions. “Machine learning is the scientific study of algorithm and statistical model that allow software applications to make decisions autonomously without being explicitly programmed by programmers.” 

Types of Machine Learning

Machine Learning is broadly divided into three parts. ML Engineers and data geeks mostly use Supervised Machine Learning and Unsupervised Machine Learning. Also, these algorithms are simple to learn and the easiest to implement. In contrast, Reinforcement Learning is very powerful and complex to apply. Let’s check out what do they mean!

Supervised Machine Learning

In this type of Machine Learning, we need to train the model with lots of training data. It is the easiest to learn and simplest to implement, similar to teaching a child with the use of flashcards. After training the model with new data and the logic we got before we predict the output. When fully trained, this algorithm will be able to understand new data and would predict a good output for it. Some of the algorithms that come under Supervised Machine Learning are:

  • Random Forest
  • Decision Trees
  • Logistic Regression
  • Decision Trees
  • Linear Regression
  • Gaussian Naive Bayes
  • K- Nearest Neighbor (KNN)
  • Support Vector Machine (SVM)

Examples of Supervised Learning

Social Media Services like Facebook, Instagram is utilizing machine learning for their own and user benefits, they have personalized our news feed and better ads targeting. Some other features which are the application of machine learning:

  • People You May Know: Facebook continuously observes the friends that we connect with, our mutual friends, most often visited profiles and pages, your interests, workplace etc. As a result, Facebook suggests us a list of Facebook users that we can become friends with.
  • Face RecognitionWhen we upload a picture with our friend, Facebook instantly recognize that friend by checking the poses and projections in the picture, the unique features, and then match them with the people in our friend list which is a very complicated process at the backend. 
  • Similar Pins: With Computer Vision, we can extract useful information from images and videos. Pinterest uses computer vision to identify the pins in the images and recommend similar pins.

Unsupervised Machine Learning

Unsupervised Machine Learning is sufficient in learning itself. It is opposite to supervised learning since the data is unlabeled. From the data and accurate tools, it can learn to group, cluster, or organize the data. So that a human or other intelligent algorithm can make sense of the newly organized data. This type of learning is data-driven as the outcomes are controlled by the data and the way it’s formatted. Some areas used in Unsupervised Algorithm are:

  • Hierarchical clustering
  • Probabilistic Clustering 
  • K-means
  • Principal Component Analysis
  • Anomaly Detection

Examples of Unsupervised Learning

  • Product Recommendation: We may have noticed, when we do online shopping, we keep receiving emails for shopping suggestions or might have noticed that the website or the app recommend us some items that somehow matches with the previous item we kept in our cart all this magic is done by the Machine Learning. Our past purchases, items liked or added to cart, brand preferences etc helps in filtering the product recommendation.
  • Buying Habits: These buying habits of customers are stored somewhere in the database which further can be used to group customers into similar purchasing segments. These can help to resemble recommender systems and even help companies to group things accordingly.

Reinforcement Learning

Reinforcement Learning is very much different from Supervised and Unsupervised Learning. It is behaviour driven, which learns from its mistakes. This algorithm will make a lot of mistakes during the onset but over time it learns to make fewer mistakes than it used to. We provide some sort of signal to the algorithm that associates good behaviours with a positive signal and bad behaviours with a negative one. Further, we can reinforce the algorithm to select good behaviours over bad ones. Important learning algorithms are:

  • Deep Q Network (DQN)
  • State-Action-Reward-State-Action (SARSA)
  • Q learning

Let us imagine that our RL Agent is learning to play Super Mario.

  • The RL agent (one who takes the action) receives state S⁰ from the environment (where the agent takes the action) i.e. Mario
  • Based on that state S⁰(situation in which the agent is)the RL agent takes an action A⁰(work done by the agent), say — our RL agent moves right. Initially, this is random.
  • Now, the environment is in a new state  (new frame from Mario)
  • The environment gives some reward R¹(the measurement of success or failure) to the RL agent.

The loop to work continues until we are dead or we reach our destination. It continuously loops around state, action and reward. Above all, the aim of the RL agent is to maximize the reward.

Examples of Reinforcement Learning

  • Game Playing: If we were to code using traditional techniques, we need to mention a large number of rules to cover all the possible possibilities. Meanwhile, with reinforcement learning, we do not need to manually write any rules. The agent will learn to play the game. It is also used in Manufacturing, Inventory Management, Delivery Management, and Finance Sector.
  • Robotics and Industrial Automation: RL has contributed significantly to Industrial Automation. For example, Google has reduced energy consumption (HVAC) in its data centres. RL allows the robot to autonomously discover optimal behaviour through trial-and-error interactions with its environment. The agent provides constructive feedback that measures the one-step performance of the robot.

Our world is drastically changing with machine learning becoming more popular in everything we use each day. The day will soon come when we can expect that our technology will be personalized, insightful, and self-correcting.

Supervised vs Unsupervised vs Reinforcement

The amount of data generated in the world today is very huge. This data is generated not only by humans but also by smartphones, computers and other devices. Based on the kind of data available and a motive present, certainly, a programmer will choose how to train an algorithm using a specific learning model.

Machine Learning is a part of Computer Science where the efficiency of a system improves itself by repeatedly performing the tasks by using data instead of explicitly programmed by programmers. Further let us understand the difference between three techniques of Machine Learning- Supervised, Unsupervised and Reinforcement Learning.

Supervised Learning

Consider yourself as a student sitting in a classroom wherein your teacher is supervising you, “how you can solve the problem” or “whether you are doing correctly or not”. Likewise, in Supervised Learning input is provided as a labelled dataset, a model can learn from it to provide the result of the problem easily.

Types of Problems

Supervised Learning deals with two types of problem- classification problems and regression problems.

Classification problems

This algorithm helps to predict a discrete value. It can be thought, the input data as a member of a particular class or group. For instance, taking up the photos of the fruit dataset, each photo has been labelled as a mango, an apple, etc. Here, the algorithm has to classify the new images into any of these categories. Examples:

  • Naive Bayes Classifier
  • Support Vector Machines
  • Logistic Regression

Regression problems

These problems are used for continuous data. For example, predicting the price of a piece of land in a city, given the area, location, number of rooms, etc. And then the input is sent to the machine for calculating the price of the land according to previous examples. Examples-

  • Linear Regression
  • Nonlinear Regression
  • Bayesian Linear Regression

Unsupervised Learning

This learning algorithm is completely opposite to Supervised Learning. In short, there is no complete and clean labelled dataset in unsupervised learningUnsupervised learning is self-organized learning. Its main aim is to explore the underlying patterns and predicts the output.  Here we basically provide the machine with data and ask to look for hidden features and cluster the data in a way that makes sense. Example

  • K – Means clustering
  • Neural Networks
  • Principal Component Analysis

Reinforcement Learning

It is neither based on supervised learning nor unsupervised learning. Moreover, here the algorithms learn to react to an environment on their own. It is rapidly growing and moreover producing a variety of learning algorithms. These algorithms are useful in the field of Robotics, Gaming etc.

For a learning agent, there is always a start state and an end state. However, to reach the end state, there might be a different path. In Reinforcement Learning Problem an agent tries to manipulate the environment. The agent travels from one state to another. The agent gets the reward(appreciation) on success but will not receive any reward or appreciation on failure. In this way, the agent learns from the environment.

Key Differences Between Supervised vs Unsupervised Learning vs Reinforcement Learning

  1. Supervised Learning deals with two main tasks Regression and Classification. Unsupervised Learning deals with clustering and associative rule mining problems. Whereas Reinforcement Learning deals with exploitation or exploration, Markov’s decision processes, Policy Learning, Deep Learning and value learning.
  2. Supervised Learning works with the labelled data and here the output data patterns are known to the system. But, the unsupervised learning deals with unlabeled data where the output is based on the collection of perceptions. Whereas in Reinforcement Learning Markov’s Decision process- the agent interacts with the environment in discrete steps.
  3. The name itself says, Supervised Learning is highly supervised. And Unsupervised Learning is not supervised. As against, Reinforcement Learning is less supervised which depends on the agent in determining the output.
  4. The input data in Supervised Learning in labelled data. Whereas, in Unsupervised Learning the data is unlabelled. The data is not predefined in Reinforcement Learning.
  5. Supervised Learning predicts based on a class type. Unsupervised Learning discovers underlying patterns. And in Reinforcement Learning, the learning agent works as a reward and action system.
  6. Supervised learning maps labelled data to known output. Whereas, Unsupervised Learning explore patterns and predict the output. Reinforcement Learning follows a trial and error method.
  7. To sum up, in Supervised Learning, the goal is to generate formula based on input and output values. In Unsupervised Learning, we find an association between input values and group them. In Reinforcement Learning an agent learn through delayed feedback by interacting with the environment.

Comparison Table

CriteriaSupervised MLUnsupervised MLReinforcement ML
DefinitionLearns by using labelled dataTrained using unlabelled data without any guidance.Works on interacting with the environment
Type of dataLabelled dataUnlabelled dataNo – predefined data
Type of problemsRegression and classificationAssociation and ClusteringExploitation or Exploration
SupervisionExtra supervisionNo supervisionNo supervision
AlgorithmsLinear Regression, Logistic Regression, SVM, KNN etc.K – Means,
C – Means, Apriori
Q – Learning,
SARSA
AimCalculate outcomesDiscover underlying patternsLearn a series of action
ApplicationRisk Evaluation, Forecast SalesRecommendation System, Anomaly DetectionSelf Driving Cars, Gaming, Healthcare