Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

What Is Regression?

Regression is a statistical method used in finance, investing, and other disciplines that attempts to
determine the strength and character of the relationship between one dependent variable (usually
denoted by Y) and a series of other variables (known as independent variables).

Regression helps investment and financial managers to value assets and understand the
relationships between variables, such as product prices and the stocks of businesses dealing in
those commodities.
Types of Regression
The two basic types of regression are simple linear regression and multiple linear regression,
although there are non-linear regression methods for more complicated data and analysis. Simple
linear regression uses one independent variable to explain or predict the outcome of the
dependent variable Y, while multiple linear regression uses two or more independent variables to
predict the outcome.
Differentiate the 2 types of Supervised Learning methods:-
Regression Classification
Regression is used to Classification is used to predict which
predict continuous values. class a data point is part of (discrete value)

Examples – once a model is trained ● Example –


based on sample data o Classifying mail as spam or not spam

o Predicting price of a house o Identifying a fruit based on size, color, length ,


given the area, no of bedrooms diameter etc
o Predicting amount of rainfall o Identifying if a tumor is benign or malignant
given temperature, humidity etc
value)

Both regression and classification are supervised learning problems where there is an input, X,
an output, Y, and the task is to learn the mapping from the input to the output. The approach in
machine learning is that we assume a model defined up to a set of parameters:
y = g(x|θ) , where g(·) is the model and θ are its parameters. Y is a number in regression and is a
class code (e.g., 0/1) in the case of classification.

Unsupervised learning
In supervised learning, the aim is to learn a mapping from the input to an output whose correct
values are provided by a supervisor. In unsupervised learning, there is no such supervisor and we
only have input data.
Unsupervised learning is a type of machine learning in which models are
trained using unlabeled dataset and are allowed to act on that data
without any supervision.

● Unsupervised learning is helpful for finding useful insights from the data.
● Unsupervised learning is much similar as a human learns to think by their own
experiences, which makes it closer to the real AI.
● Unsupervised learning works on unlabeled and uncategorized data which make
unsupervised learning more important.
● In real-world, we do not always have input data with the corresponding output so to solve
such cases, we need unsupervised learning.

Here, we have taken an unlabeled input data, which means it is not categorized and
corresponding outputs are also not given. Now, this unlabeled input data is fed to the machine
learning model in order to train it. Firstly, it will interpret the raw data to find the hidden patterns
from the data and then will apply suitable algorithms such as k-means clustering, Decision tree,
etc.Once it applies the suitable algorithm, the algorithm divides the data objects into groups
according to the similarities and differences between the objects.

The aim is to find the regularities in the input. There is a structure to the input space such that
certain patterns occur more often than others, and we want to see what generally happens and
what does not. In statistics, this is called density estimation. Example - Clustering

Types of Unsupervised Learning Algorithm:

● Clustering: Clustering is a method of grouping the objects into clusters such that objects
with most similarities remains into a group and has less or no similarities with the objects
of another group. Cluster analysis finds the commonalities between the data objects and
categorizes them as per the presence and absence of those commonalities.
● Association: An association rule is an unsupervised learning method which is used for
finding the relationships between variables in the large database. It determines the set of
items that occurs together in the dataset. Association rule makes marketing strategy more
effective. Such as people who buy X item (suppose a bread) are also tend to purchase Y
(Butter/Jam) item. A typical example of Association rule is Market Basket Analysis.

● Clustering is the task of dividing the population or data points into a number of groups such
that data points in the same groups are more similar to other data points in the same group than
those in other groups. In simple words, the aim is to segregate groups with similar traits and
assign them into clusters.
● Clustering has a large no. of applications spread across various domains. Some of the
most popular applications of clustering are:
1. Recommendation engines
2. Market segmentation
3. Social network analysis
4. Search result grouping
5. Medical imaging
6. Image segmentation
7. Anomaly detection

Clustering for Image Compression


In this case, the input instances are image pixels represented as RGB values. A clustering
program groups pixels with similar colors in the same group, and such groups correspond to
the colors occurring frequently in the image. If in an image, there are only shades of a small
number of colors, and if we code those belonging to the same group with one color, for
example, their average, then the image is quantized. Let us say the pixels are 24 bits to
represent 16 million colors, but if there are shades of only 64 main colors, for each pixel we
need 6 bits instead of 24. For example, if the scene has various shades of blue in different
parts of the image, and if we use the same average blue for all of them, we lose the details in
the image but gain space in storage and transmission.

Clustering for Document Clustering


In document clustering, the aim is to group similar documents. For example, news reports can
be subdivided as those related to politics, sports, fashion, arts, and so on. Commonly, a
document is represented as a bag of words, that is, we predefine a lexicon of N words and
each document is an N-dimensional binary vector whose element i is 1 if word i appears in
the document; suffixes “–s” and “–ing” are removed to avoid duplicates and words such as
“of,” “and,” and so forth, which are not informative, are not used. Documents are then
grouped depending on the number of shared words.

Advantages of Unsupervised Learning

● Unsupervised learning is used for more complex tasks as compared to supervised


learning because, in unsupervised learning, we don't have labeled input data.
● Unsupervised learning is preferable as it is easy to get unlabeled data in comparison to
labeled data.

Disadvantages of Unsupervised Learning

● Unsupervised learning is intrinsically more difficult than supervised learning as it does


not have corresponding output.
● The result of the unsupervised learning algorithm might be less accurate as input data is
not labeled, and algorithms do not know the exact output in advance.

Supervised learning Unsupervised learning


1. Supervised learning is where you have 1. Unsupervised learning is where you
input variables (x) and an output variable (Y) only have input data (X) and no
and you use an algorithm to learn the mapping corresponding output variables.
function from the input to the output. Y = f(X) The goal for unsupervised learning is to
model the underlying structure or
The goal is to approximate the mapping distribution in the data in order to learn more
function so well that when you have new about the data.
input data (x) that you can predict the output
variables (Y) for that data.

2. It is called supervised learning because the 2. These are called unsupervised learning
process of an algorithm learning from the because unlike supervised learning above
training dataset can be thought of as a teacher there are no correct answers and there is no
supervising the learning process. We know the teacher. Algorithms are left to their own
correct answers, the algorithm iteratively devices to discover and present the interesting
makes predictions on the training data and is structure in the data.
corrected by the teacher. Learning stops when
the algorithm achieves an acceptable level of
performance.

3. Supervised learning problems can be 3. Unsupervised learning problems can


further grouped into regression and be further grouped into clustering and
classification problems. association problems.

4.Supervised learning model produces an 4.Unsupervised learning model may give less
accurate result. accurate result as compared to supervised
learning.

5.Supervised learning model predicts the 5.Unsupervised learning model finds the
output. hidden patterns in data.
Reinforcement Learning
In some applications, the output of the system is a sequence of actions. In such a case, a single
action is not important; what is important is the policy that is the sequence of correct actions to
reach the goal. In the Reinforcement learning scenario there is a decision maker, called the
agent, that is placed in an environment. At any time, the environment is in a certain state .The
decision
maker has a set of actions possible. Once an action is chosen and taken, the state changes. The
solution to the task requires a sequence of actions, and we get feedback, in the form of a reward.
The learning agent learns the best sequence of actions to solve a problem where “best” is
quantified as the sequence of actions that has the maximum cumulative reward. Such is the
setting of 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.

In Reinforcement Learning, the agent learns automatically using feedback without any labeled
data, unlike supervised learning.Since there is no labeled data, the agent is bound to learn by its
experience only.

RL solves a specific type of problem where decision making is sequential, and the goal is
long-term, such as game-playing, robotics, etc.
The agent interacts with the environment and explores it by itself. The primary goal of an agent
in reinforcement learning is to improve the performance by getting the maximum positive
rewards.

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.

It is a core part of AI and all AI agents work on the concept of reinforcement learning. Here we
do not need to pre-program the agent, as it learns from its own experience without any human
intervention.

Example: Suppose there is an AI agent present within a maze environment, and his goal is to
find the diamond. The agent interacts with the environment by performing some actions, and
based on those actions, the state of the agent gets changed, and it also receives a reward or
penalty as feedback.

The mathematical framework for defining a solution in reinforcement learning scenario is called
Markov Decision Process. This can be designed as:
● Set of states, S
● Set of actions, A
● Reward function, R
● Policy, π
● Value, V

We have to take an action (A) to transition from our start state to our end state (S). In return
getting rewards (R) for each action we take. Our actions can lead to a positive reward or negative
reward. The set of actions we took define our policy (π) and the rewards we get in return defines
our value (V). Our task here is to maximize our rewards by choosing the correct policy.
A good example is game playing where a single move by itself is not that important; it is
the sequence of right moves that is good. A move is good if it is part of a good game playing
policy.
A robot navigating in an environment in search of a goal location is another application area
of reinforcement learning. At any time, the robot can move in one of a number of directions.
After a number of trial runs, it should learn the correct sequence of actions to reach the goal state
from an initial state, doing this as quickly as possible and without hitting any of the obstacles.
Other examples include

● Adaptive Traffic signal optimization


● Adaptive power grid distribution
Reinforcement Learning Supervised learning

Reinforcement learning is all about In Supervised learning the decision is made on


making decisions sequentially. In simple the initial input or the input given at the start
words we can say that the output depends
on the state of the current input and the
next input depends on the output of the
previous input

In Reinforcement learning decision is Supervised learning the decisions are


dependent, So we give labels to sequences independent of each other so labels are given to
of dependent decisionsExample: Chess each decision.Example: Object recognition
game

You might also like