Professional Documents
Culture Documents
•Linear Regression
•Regression Trees
•Non-Linear Regression
•Bayesian Linear Regression
•Polynomial Regression
Classification
Classification algorithms are used when the output variable is
categorical, which means there are two classes such as Yes-
No, Male-Female, True-false, etc.
Spam Filtering,
•Random Forest
•Decision Trees
•Logistic Regression
•Support vector Machines
Advantages of Supervised learning:
•With the help of supervised learning, the model can
predict the output on the basis of prior experiences.
•In supervised learning, we can have an exact idea
about the classes of objects.
•Supervised learning model helps us to solve various
real-world problems such as fraud detection, spam
filtering, etc.
Disadvantages of supervised learning:
•Supervised learning models are not suitable for
handling the complex tasks.
•Supervised learning cannot predict the correct output
if the test data is different from the training dataset.
•Training required lots of computation times.
•In supervised learning, we need enough knowledge
about the classes of object.
Decision Tree Pruning
A 4 8
B 16 4
C 18 6
D 2 10
E 17 2
Month Overall Performance Index-1 Overall Performance Index-1
Jan. 1.4 6
Feb. 4.5 7.4
March 5 7.8
April 1.3 6.1
May 5.5 7.5
June 1.2 6.3
July 6 7.6
August 2.2 8.1
Sep. 4 7.3
Oct. 2.3 8.3
Nov. 2.4 8.2
Dec. 2.5 8.4
K-MEANS:
K-Means clustering intends to partition n objects into k clusters in which each object belongs to the cluster with
the nearest mean. This method produces exactly k different clusters of greatest possible distinction. The best
number of clusters k leading to the greatest separation (distance) is not known as a priori and must be computed
from the data. The objective of K-Means clustering is to minimize total intra-cluster variance, or, the squared
error function.
Algorithms:
1. Cluster 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.
K-Means Clustering-
•K-Means clustering is an unsupervised iterative clustering
technique.
• It partitions the given data set into k predefined distinct
clusters.
• A cluster is defined as a collection of data points exhibiting
certain similarities.
It partitions the data set such that-
• Each data point belongs to a cluster with the nearest mean.
• Data points belonging to one cluster have high degree of similarity.
• Data points belonging to different clusters have high degree of dissimilarity.
K-Means Clustering Algorithm-
K-Means Clustering Algorithm involves the following steps-
Step-01:
• Choose the number of clusters K.
Step-02:
• Randomly select any K data points as cluster centers.
• Select cluster centers in such a way that they are as farther as possible from each other.
Step-03:
• Calculate the distance between each data point and each cluster center.
• The distance may be calculated either by using given distance function or by using
euclidean distance formula.
Step-04:
• Assign each data point to some cluster.
• A data point is assigned to that cluster whose center is nearest to that data point.
Step-05:
• Re-compute the center of newly formed clusters.
• The center of a cluster is computed by taking mean of all the data points contained in that cluster.
Step-06:
Keep repeating the procedure from Step-03 to Step-05 until any of the following stopping criteria is met-
• Center of newly formed clusters do not change
• Data points remain present in the same cluster
• Maximum number of iterations are reached
REINFORCEMENT
LEARNING
Reinforcement Learning is a feedback-based
Machine learning technique in which an agent
learns to behave in an environment by
performing the actions and seeing the results of
actions. For each good action, the agent gets
positive feedback, and for each bad action, the
agent gets negative feedback or penalty.
The agent learns with the process of hit and trial, and
based on the experience, it learns to perform the task
in a better way. Hence, we can say
that "Reinforcement learning is a type of machine
learning method where an intelligent agent
(computer program) interacts with the
environment and learns to act within that." How a
Robotic dog learns the movement of his arms is an
example of Reinforcement learning.
Example: 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.
next state.
Where R(s) = reward for being in state s, P(s’|s, π(s)) = transition model, γ =
discount factor and Uπ(s) = utility of being in state s’.
It can be solved using value-iteration algorithm. The algorithm converges fast but
can become quite costly to compute for large state spaces. ADP is a model based
approach and requires the transition model of the environment. A model-free
approach is Temporal Difference Learning.
Temporal Difference Learning (TD)
TD learning does not require the agent to learn the transition model.
The update occurs between successive states and agent only updates
states that are directly affected.
affected.
Where α = learning rate which determines the convergence to true utilities. While
ADP adjusts the utility of s with all its successor states, TD learning adjusts it
with that of a single successor state s’. TD is slower in convergence but much
simpler in terms of computation.