0% found this document useful (0 votes)
46 views

Supervised Unsupervised Reinforcement

supervised learning notes

Uploaded by

abhi9anand814
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Supervised Unsupervised Reinforcement

supervised learning notes

Uploaded by

abhi9anand814
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Machine Learning is based on algorithms.

These
algorithms can be broadly classified into:
• Supervised Learning
• Unsupervised Learning
• Reinforcement Learning

23-03-2024
Supervised Learning
Supervised learning, is a subcategory of machine learning and is
defined by its use of labelled datasets to train algorithms that to
classify data or predict outcomes accurately.
As input data is fed into the model, it adjusts its weights until the
model has been fitted appropriately, which occurs as part of the cross
validation process.
Imagine you are learning a task under supervision. So, there
must be someone who will judge you whether you are getting the
right answer.
In Supervised Learning, there’s a set of fully labeled data while
training the ML algorithm
23-03-2024
23-03-2024
Examples of supervised machine learning tasks include:
• 1. Identifying the zip code from handwritten digits on an envelope:
• Here the input is a scan of the handwriting, and the desired output is
the actual digits in the zip code. To create a dataset for building a
machine learning model, you need to collect many envelopes. Then
you can read the zip codes yourself and store the digits as your
desired outcomes.
Fully labeled data signifies each example in the training dataset
is tagged with the answer the algorithm should come up with on
its own. So, as you can see from the above diagram, it takes
labeled data as input, finds out the algorithm, and then tests the
new data and predicts the label. Supervised learning is, thus,
best suited to problems where there is a set of available
reference points or a ground truth with which to train the
algorithm. But those aren’t always available.

23-03-2024
Examples of supervised machine learning tasks include:
• 2. Determining whether a tumor is benign based on a medical image
• Here the input is the image, and the output is whether the tumor is
benign. To create a dataset for building a model, you need a database
of medical images. You also need an expert opinion, so a doctor
needs to look at all of the images and decide which tumors are benign
and which are not. It might even be necessary to do additional
diagnosis beyond the content of the image to determine whether the
tumor in the image is cancerous or not.
Examples of supervised machine learning tasks include:
• 3. Detecting fraudulent activity in credit card transactions
• Here the input is a record of the credit card transaction, and the
output is whether it is likely to be fraudulent or not. Assuming that
you are the entity distributing the credit cards, collecting a dataset
means storing all transactions and recording if a user reports any
transaction as fraudulent.
• The main goal of the supervised learning technique is to
map the input variable(x) with the output variable(y). Some
real-world applications of supervised learning are Risk
Assessment, Fraud Detection, Spam filtering, etc.
Categories of Supervised Machine Learning

• Classification
• Regression
Classification
• Classification algorithms are used to solve the classification
problems in which the output variable is categorical, such as
"Yes" or No, Male or Female, Red or Blue, etc.
• The classification algorithms predict the categories present in
the dataset. Some real-world examples of classification
algorithms are Spam Detection, Email filtering, etc.
• Classification uses an algorithm to accurately assign test data into
specific categories.
• It recognizes specific entities within the dataset and attempts to draw
some conclusions on how those entities should be labelled or
defined.
Some popular classification algorithms are given
below:
• Linear Classifiers
• Random Forest Algorithm
• Decision Tree Algorithm
• Logistic Regression Algorithm
• Support Vector Machine Algorithm
• k-nearest Neighbour Algorithm
Regression
• Regression algorithms are used to solve regression problems in
which there is a linear relationship between input and output
variables.
• These are used to predict continuous output variables, such as
market trends, weather prediction, etc.
• Regression is used to understand the relationship between
dependent and independent variables.
• It is commonly used to make projections, such as for sales revenue for
a given business.
Some popular Regression algorithms are given
below:
• Simple Linear Regression Algorithm
• Multivariate Regression Algorithm
• Decision Tree Algorithm
• Lasso Regression
Applications of Regression
• Predicting prices: For example, a regression model could be used to
predict the price of a house based on its size, location, and other
features.
• Forecasting trends: For example, a regression model could be used to
forecast the sales of a product based on historical sales data and
economic indicators.
• Identifying risk factors: For example, a regression model could be
used to identify risk factors for heart disease based on patient data.
• Making decisions: For example, a regression model could be used to
recommend which investment to buy based on market data.
• Some common applications of Supervised Learning are given below:
• Image Segmentation
• Medical Diagnosis
• Estimating Patient Recovery Times
• Predictive analytics
• Fraud Detection
• Forecasting Sales Figures
• Spam detection
• Speech Recognition
• Predicting House Prices
• Customer sentiment analysis
Which of the following is a regression task?
• Predicting nationality of a person
• Predicting age of a person
• Predicting whether stock price of a company will increase tomorrow
• Predicting whether a document is related to sighting of UFOs?
• Some common applications of Supervised Learning are given below:
• Image Segmentation
• Medical Diagnosis
• Fraud Detection
• Spam detection
• Speech Recognition
• Predicting House Prices
• Forecasting Sales Figures
• Estimating Patient Recovery Times
• Predictive analytics
• Customer sentiment analysis
• Spam detection
Unsupervised Learning
Unsupervised learning uses unlabelled data.
From that data, it discovers patterns that help solve for clustering or
association problems.
This is particularly useful when subject matter experts are unsure of
common properties within a data set.
In unsupervised learning, it’s the main motto is to learn more about the
data by the interfering pattern in the dataset. Unsupervised learning is
mostly performed as a part of exploratory data analysis.

23-03-2024
Unsupervised Learning
Unsupervised learning is different from the Supervised learning
technique; as its name suggests, there is no need for supervision. It
means, in unsupervised machine learning, the machine is trained using
the unlabeled dataset, and the machine predicts the output without any
supervision.
In unsupervised learning, the models are trained with the data that is
neither classified nor labelled, and the model acts on that data without
any supervision.
The main aim of the unsupervised learning algorithm is to group or
categories the unsorted dataset according to the similarities,
patterns, and differences.
Machines are instructed to find the hidden patterns from the input
dataset.
23-03-2024
Notice the above screenshot, it attempts to automatically find
structure in the data by extracting useful features and analyzing
its structure.

23-03-2024
Examples of unsupervised learning include
Identifying topics in a set of blog posts
If you have a large collection of text data, you might want to summarize
it and put prevalent themes in it. You might not know beforehand what
these topics are, or how many topics there might be. Therefore, there
are no known outputs.
Examples of unsupervised learning include
• Segmenting customers into groups with similar preferences
Given a set of customer records, you might want to identify which
customers are similar, and whether there are groups of customers with
similar preferences.
For a shopping site, these might be “parents,” “bookworms,” or
“gamers.” Because you don't know in advance what these groups might
be, or even how many there are, you have no known outputs.
Examples of unsupervised learning include
• Detecting abnormal access patterns to a website:
To identify abuse or bugs, it is often helpful to find access patterns that
are different from the normal. Each abnormal pattern might be very
different, and you might not have any recorded instance or abnormal
behaviour.
Because in this example you only observe traffic, and you don't know
what constitutes normal and abnormal behavior, this is an
unsupervised problem.
Categories of Unsupervised Machine
Learning

• Unsupervised Learning can be further classified into two types,


which are given below:
• Clustering
• Association
Clustering
• The clustering technique is used when we want to find the
inherent groups from the data.
• It is a way to group the objects into a cluster such that the
objects with the most similarities remain in one group and have
fewer or no similarities with the objects of other groups.
• An example of the clustering algorithm is grouping the
customers by their purchasing behaviour.
Some of the popular clustering algorithms are
given below:

• Hierarchical
• K-Means Clustering algorithm
• Mean-shift algorithm
• DBSCAN Algorithm
• Principal Component Analysis
• Independent Component Analysis
• Gaussian mixture models
Association
• Association rule learning is an unsupervised learning technique,
which finds interesting relations among variables within a large
dataset.
• The main aim of this learning algorithm is to find the
dependency of one data item on another data item and map
those variables accordingly so that it can generate maximum
profit.
• This algorithm is mainly applied in Market Basket analysis,
Web usage mining, continuous production, etc.
Some popular algorithms of Association rule
learning are

• Apriori Algorithm
• Eclat
• FP-growth algorithm
Reinforcement Learning
• Reinforcement learning is an area of Machine Learning.
• It is about taking suitable action to maximize reward in a particular
situation.
• It is employed by various software and machines to find the best possible
behaviour or path it should take in a specific situation.
• Reinforcement learning differs from supervised learning in a way that in
supervised learning the training data has the answer key with it so the
model is trained with the correct answer itself whereas in reinforcement
learning, there is no answer but the reinforcement agent decides what to
do to perform the given task.
• In the absence of a training dataset, it is bound to learn from its
experience.
Reinforcement Learning
• Reinforcement Learning (RL) is the science of decision making.
• It is about learning the optimal behaviour in an environment to obtain maximum reward.
• In RL, the data is accumulated from machine learning systems that use a trial-and-error
method.
• Data is not part of the input that we would find in supervised or unsupervised machine
learning.
• Reinforcement learning uses algorithms that learn from outcomes and decide which
action to take next.
• After each action, the algorithm receives feedback that helps it determine whether the
choice it made was correct, neutral or incorrect.
• It is a good technique to use for automated systems that have to make a lot of small
decisions without human guidance.
• Reinforcement learning is an autonomous, self-teaching system that essentially learns by
trial and error. It performs actions with the aim of maximizing rewards, or in other
words, it is learning by doing in order to achieve the best outcomes.
Example: Reinforcement Learning
• Video games are full of reinforcement cues.
• Complete a level
• and earn a badge.
• Defeat the bad guy in a certain number of moves
• and earn a bonus.
• Step into a trap —
• game over.
• These cues help players learn how to improve their performance for the next game. Without this feedback, they
would just take random actions around a game environment in the hopes of advancing to the next level.
• Reinforcement learning operates on the same principle — and actually, video games are a common test
environment for this kind of research.
• In this kind of machine learning, AI agents are attempting to find the optimal way to accomplish a particular goal
or improve performance on a specific task.
• It’s an iterative process: the more rounds of feedback, the better the agent’s strategy becomes. This technique is
especially useful for training robots, which make a series of decisions in tasks like steering an autonomous
vehicle or managing inventory in a warehouse.

23-03-2024
The problem is as follows: We have an agent and a reward, with many hurdles in between. The agent is
supposed to find the best possible path to reach the reward. The following problem explains the problem more
easily. The above image shows the robot, diamond, and fire. The goal of the robot is to get the reward that is the
diamond and avoid the hurdles that are fired. The robot learns by trying all the possible paths and then choosing
the path which gives him the reward with the least hurdles. Each right step will give the robot a reward and each
wrong step will subtract the reward of the robot. The total reward will be calculated when it reaches the final
reward that is the diamond.
Applications of Reinforcement Learning
Reinforcement learning is on the rise and its future is just as vibrant.
Here, we’ll take a look at some of the current ways RL is working in the real world.
1. Automated Robots: While most robots don’t look like pop culture has led us to believe, their capabilities are just as impressive. The more robots
learn using RL, the more accurate they become, and the quicker they can complete a previously arduous task. They can also perform duties that
would be dangerous for people with far less consequences. For these reasons, aside from requiring some oversight and regular maintenance,
robots are a cost-effective and efficient alternative to manual labor.For example, some restaurants use robots to deliver food to tables. Grocery
stores are using robots to identify where shelves are low and order more product. In common settings, automated robots have been used thus far
to assemble products; inspect for defects; count, track, and manage inventory; deliver goods; travel long and short distances; input, organize, and
report on data; and grasp and handle objects of all different shapes and sizes. As we continue to test robotic abilities, new features are being
introduced to expand their potential.
2. Natural Language Processing: Predictive text, text summarization, question answering, and machine translation are all examples of natural
language processing (NLP) that uses reinforcement learning. By studying typical language patterns, RL agents can mimic and predict how people
speak to each other every day. This includes the actual language used, as well as syntax, (the arrangement of words and phrases) and diction (the
choice of words).In 2016, researchers from Stanford University, Ohio State University, and Microsoft Research used this learning to generate
dialogue, like what’s used for chatbots. Using two virtual agents, they simulated conversations and used policy gradient methods to reward
important attributes such as coherence, informativity, and ease of answering.5 This research was unique in that it didn’t only focus on the
question at hand, but also on how an answer could influence future outcomes. This approach to reinforcement learning in NLP is now widely
adopted and used by customer service departments in many major organizations.
3. Marketing and Advertising: Both brands and consumers can use reinforcement learning to their benefit. For brands selling to target audiences,
they can use real-time bidding platforms, A/B testing, and automatic ad optimization. This means that they can place a series of advertisements in
the marketplace and the host will automatically serve the best-performing ads in the best spots for the lowest prices.2,5 Although brands post
and set up the campaigns themselves, marketing and advertising platforms are also learning which types of ads are resonating with audiences
and will display those ads more frequently and prominently. From a consumer perspective, you might notice that the ads you receive are usually
from companies whose websites you’ve visited before, whom you have bought from before, or are in the same industry as a company from which
you’ve made a purchase. That’s because marketing and advertising platforms can use reinforcement learning to associate similar companies,
products, and services to prioritize for certain customers. If they try certain options and receive a click or other engagement, it signals that they
were ‘correct’ and should employ the same strategy again
Applications of Reinforcement Learning
4. Image Processing: Have you ever taken a security test that asked you to identify objects in frames,
such as “Click on the photos that have a street sign in them”? This is similar to what learning
machines can do, although they approach it in a different way. When asked to process an image, RL
agents will search an entire image as their starting point, then identify objects sequentially until
everything is registered. Artificial vision systems also use deep convolutional neural networks, made
up of large, labelled datasets, to map images to human-generated scene descriptions from
simulation engines.2Some more examples of reinforcement learning in image processing
include:2Robots equipped with visual sensors from to learn their surrounding environment
Scanners to understand and interpret text Image pre-processing and segmentation of medical
images, like CT Scans Traffic analysis and real-time road processing by video segmentation and
frame-by-frame image processing CCTV cameras for traffic and crowd analytics
5. Recommendation Systems The “Frequently Bought Together” section on Amazon, a “Customers
Also Liked” tab online at Target, and the “Recommended Reading” articles from news outlets all
utilize learning machines to generate recommendations. Specifically for news reading, RL agents can
track the types of stories, topics, and even author names someone prefers so that the system can
queue the next story they think they would enjoy. That includes the details of exactly how they
interact with the content, e.g., clicks and shares, and aspects such as timing and freshness of the
news. A reward is then defined based on these user behaviors.5Recommendation systems also
analyze past behaviours to try to predict future ones. So if, for example, a hundred people who
bought ski pants then went on to buy ski boots, a company’s system learns to send ads for ski boots
to anyone who just bought ski pants. If the ads are unsuccessful, they might try to display ads for ski
jackets, instead, and see how the results compare
Applications of Reinforcement Learning
6. Gaming: From creating a new game, to testing its bugs, to defeating its levels, RL is an efficient
and relatively easy resource on which programmers can rely. Compared to traditional video games
that require complex behavioral trees to craft the logic of the game, training an RL model is much
simpler. Here, the agent will learn by itself in the simulated game environment through navigation,
defense, attack, and strategizing.2 Through trial and error, they’ll begin to perform the necessary
actions to reach the desired goal.RL agents are also used in bug detection and game testing. This is
due to its ability to run a large number of iterations without human input, stress testing, and
creating situations for potential bugs.
7. Energy ConservationAs much of the world works to lower their effects on the climate, reducing
energy consumption is at the top of the list. A prime example is the partnership between Deepmind
and Google to cool massive and essential Google Data Centers. With a fully-functioning AI system,
the centers saw a 40% reduction in energy spending without the need for human intervention—
though there is still some supervision from data center experts.5,6The system works in the
following way:5Taking snapshots of data from the data centers every five minutes and feeding this
to deep neural networksPredicting how different combinations will affect future energy
consumptionsIdentifying actions that will lead to minimal power consumption while maintaining a
set standard of safety criteriaSending and implementing these actions at the data centerVerifying
the actions by the local control systemAnother example may be an Eco setting on your thermostat,
or motion-activated lights that offer different settings based on the level of light already in the
room.
Applications of Reinforcement Learning
8. Traffic ControlCivil engineers have been struggling with traffic for centuries, but
reinforcement learning is working to help solve that. Continuous traffic monitoring
in complex urban networks helps build a literal and figurative “map” of traffic
patterns and vehicle behavior. Due to its data-driven nature, the RL agents can start
to learn when traffic is heaviest, which directions it’s coming from, and how quickly
cars are moving through each light color.2 Then, they adapt accordingly and
continue to test and learn across times, climates, and seasons.9.
HealthcareHealthcare employs machine learning and artificial intelligence in much
of its work, and RL is no exception. It has been used in automated medical
diagnosis, resource scheduling, drug discovery and development, and health
management.5One important avenue for deploying reinforcement learning is in
dynamic treatment regimes (DTRs). To create a DTR, someone must input a set of
clinical observations and assessments of a patient. Using previous outcomes and
patient medical history, the learning system will then output a suggestion on
treatment type, drug dosages, and appointment timing for every stage of the
patient’s journey. This is extremely beneficial for making time-dependent decisions
for the best treatment for a patient at a specific time without expending much
time, energy, or effort to consult with multiple parties.
Categories of Reinforcement Learning
• Reinforcement learning is categorized mainly into two types of
methods/algorithms:
• Positive Reinforcement Learning: Positive reinforcement
learning specifies increasing the tendency that the required
behaviour would occur again by adding something. It enhances
the strength of the behaviour of the agent and positively impacts
it.
• Negative Reinforcement Learning: Negative reinforcement
learning works exactly opposite to the positive RL. It increases
the tendency that the specific behaviour would occur again by
avoiding the negative condition.

You might also like