1.supervised and Unsupervised
1.supervised and Unsupervised
1.supervised and Unsupervised
Agenda
• Types of Unsupervised Learning
• Clustering types
• k-Means Algorithm & Use cases
• Optimization objective
• Random Initialization
• Use cases
• Principal components analysis
• Independent components analysis,
• Reinforcement Learning
Un Supervised Machine Learning
• Unsupervised learning is a type
of machine learning algorithm
used to draw inferences from
datasets consisting of input data
without labeled responses.
• We want to explore the data to
find some intrinsic structures
in them.
Input Data Algorithms are trained using labeled Algorithms are used against data
data. which is not labelled
• Hierarchical clustering
• K-means clustering
• Principal Component Analysis
• Singular Value Decomposition
• Independent Component Analysis
Uses of clustering algorithms
• A clustering algorithm
• Partitional clustering
• Hierarchical clustering
• A distance (similarity, or dissimilarity) function
• Clustering quality
• Inter-clusters distance Þ maximized
• Intra-clusters distance Þ minimized
• The quality of a clustering result depends on the algorithm, the distance
function, and the application.
K-means clustering
Algorithm
1.Clusters the data into k groups where k is predefined.
2.Select k points at random as cluster centers.
3.Assign objects to their closest cluster center according to the Euclidean distance function.
4.Calculate the centroid or mean of all objects in each cluster.
5.Repeat steps 2, 3 and 4 until the same points are assigned to each cluster in consecutive
rounds.
Where Should I Set up My New Coffee Shops?
• Let's say we want to open three
new coffee shops in a town
called, George - this is all
hypothetically thinking. However,
we need to scope out the prime
locations for our coffee shops to
thrive.
• Outlined below, we have a data
set of all the people that make
use of coffee shops regularly in
the surrounding area:
Where Should I Set up My New Coffee Shops?
• Let's say we want to open three
new coffee shops in a town
called, George - this is all
hypothetically thinking. However,
we need to scope out the prime
locations for our coffee shops to
thrive.
• Outlined below, we have a data
set of all the people that make
use of coffee shops regularly in
the surrounding area:
Where Should I Set up My New Coffee Shops?
• In step 2, we need to group each
observation to a certain center
point, and we do this by computing
the distance between each
observation and each center point.
STEP 1: STANDARDIZATION:
LAST STEP : RECAST THE DATA ALONG THE PRINCIPAL COMPONENTS AXES
The aim is to use the feature vector formed using the eigenvectors of the covariance matrix, to reorient the data
from the original axes to the ones represented by the principal components (hence the name Principal
Components Analysis). This can be done by multiplying the transpose of the original data set by the transpose of
the feature vector
Independent Component Analysis (ICA)
It reduces the dimensions to avoid the It decomposes the mixed signal into its
problem of overfitting. independent sources’ signals.
It deals with the Principal Components. It deals with the Independent Components.
•Agent: It is an assumed entity which performs actions in an environment to gain some reward.
•Environment (e): A scenario that an agent has to face.
•Reward (R): An immediate return given to an agent when he or she performs specific action or task.
•State (s): State refers to the current situation returned by the environment.
•Policy (π): It is a strategy which applies by the agent to decide the next action based on the current state.
•Value (V): It is expected long-term return with discount, as compared to the short-term reward.
•Value Function: It specifies the value of a state that is the total amount of reward. It is an agent which should be
expected beginning from that state.
•Model of the environment: This mimics the behavior of the environment. It helps you to make inferences to be
made and also determine how the environment will behave.
•Model based methods: It is a method for solving reinforcement learning problems which use model-based
methods.
•Q value or action value (Q): Q value is quite similar to value. The only difference between the two is that it takes
an additional parameter as a current action.
• Exploration vs Exploitation trade-off:In order to build an optimal policy, the agent faces the dilemma of exploring
new states while maximizing its reward at the same time.
Difference between Reinforcement learning and Supervised learning:
▪ The Markov property states that,“ The future is independent of the past given the
present.”
▪ However, real world environments are more likely to lack any prior
knowledge of environment dynamics.
▪ Model-free RL methods come handy in such cases.
Markov Decision Processes (MDPs)
Markov Decision Processes (MDPs)
Action Based Future Situations
Markov Decision Processes (MDPs)
Action Based Future Situations
Markov Decision Processes (MDPs)
Action Based Future Situations
Q-Learning
Q-learning is a model-free reinforcement learning algorithm.
Q-learning is an off-policy learner. Means it learns the value of the optimal policy
independently of the agent’s actions.
On the other hand, an on-policy learner learns the value of the policy being carried
out by the agent, including the exploration steps and it will find a policy that is
optimal, taking into account the exploration inherent in the policy.
Q-learning Definition
From the above, we can say that Reinforcement Learning is one of the
most interesting and useful parts of Machine learning.
In RL, the agent explores the environment by exploring it without any
human intervention. It is the main learning algorithm that is used in
Artificial Intelligence.
But there are some cases where it should not be used, such as if you
have enough data to solve the problem, then other ML algorithms can
be used more efficiently.
The main issue with the RL algorithm is that some of the parameters
may affect the speed of the learning, such as delayed feedback.
Thank You