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

Unit2_Introduction_To_Problem_Solving

The document introduces problem-solving concepts in psychology and computer science, emphasizing the importance of algorithms and heuristics. It discusses various search strategies, including uninformed and informed searches, and highlights game theory's relevance in artificial intelligence, particularly through examples like the Prisoner's Dilemma and the Minimax algorithm. Additionally, it covers problem decomposition and Means-Ends Analysis as techniques for simplifying complex problems.

Uploaded by

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

Unit2_Introduction_To_Problem_Solving

The document introduces problem-solving concepts in psychology and computer science, emphasizing the importance of algorithms and heuristics. It discusses various search strategies, including uninformed and informed searches, and highlights game theory's relevance in artificial intelligence, particularly through examples like the Prisoner's Dilemma and the Minimax algorithm. Additionally, it covers problem decomposition and Means-Ends Analysis as techniques for simplifying complex problems.

Uploaded by

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

Unit II

INTRODUCTION
TO PROBLEM
SOLVING
- Praveen Kumar R
WHAT IS PROBLEM
SOLVING ?
We have a problem and want to find a solution !
Different meanings in different contexts …
From Wikipedia (!) :
In psychology, problem solving refers to a state
of desire for reaching a definite goal from a
present condition that either is not directly
moving toward the goal, is far from it, or needs
more complex logic for finding a missing
description of conditions or steps toward the
goal.
In computer science and in the part of artificial
intelligence that deals with algorithms, problem
solving encompasses a number of techniques
known as algorithms, heuristics, root cause
analysis, etc.
IDEALLY PROBLEM SOLVING
Solve
Problem Solution

IN PRACTICE
Solve
Problem Solution
Informal
abstraction
interpretation
Compute Formal
Representation Output
SOLUTION
WHAT IS A SOLUTION?

Formula to be satisfied or set of


conditions to be achieved
unique solution ? Several solutions ?
Some solution are better than others ?
Optimal solution
Sometimes too hard to find
Approximate solution
Quality of solution improving with time
Anytime algorithms
UNGUIDED/UNINFORMED SEARCH
Uninformed search is a class of general-purpose search algorithms which operates in brute force-way. Uninformed
search algorithms do not have additional information about state or search space other than how to traverse the
tree, so it is also called blind search.
Following are the various types of uninformed search algorithms:

1 Breadth-first Search 2 Depth-first Search


3 Depth-limited Search 4 Iterative deepening depth-first search
5 Uniform cost search 6 Bidirectional Search
BREADTH FIRST SEARCH
Breadth-first search is the most common search strategy for
traversing a tree or graph. This algorithm searches breadthwise
in a tree or graph, so it is called breadth-first search.
BFS algorithm starts searching from the root node of the tree and
expands all successor node at the current level before moving to
nodes of next level.
The breadth-first search algorithm is an example of a general-
graph search algorithm.
Breadth-first search implemented using FIFO queue data
structure.
ADVANTAGES
BFS will provide a solution if any solution exists.
If there are more than one solutions for a given problem, then
BFS will provide the minimal solution which requires the least
number of steps.
DIS ADVANTAGES
It requires lots of memory since each level of the tree must be
To Find K from S BFS will traverse like below saved into memory to expand the next level.
S---> A--->B---->C--->D---->G--->H--->E---->F---->I---->K BFS needs lots of time if the solution is far away from the root
node.
GUIDED/ INFORMED SEARCH
informed search algorithm contains an array of knowledge such as
how far we are from the goal, path cost, how to reach to goal node,
etc. This knowledge help agents to explore less to the search space
and find more efficiently the goal node.
The informed search algorithm is more useful for large search
space. Informed search algorithm uses the idea of heuristic, so it is
also called Heuristic search.
HEURISTICS FUNCTION
Heuristic is a function which is used in Informed Search, and it finds the
most promising path. It takes the current state of the agent as its input and
produces the estimation of how close agent is from the goal. The heuristic
method, however, might not always give the best solution, but it
guaranteed to find a good solution in reasonable time. Heuristic function
estimates how close a state is to the goal. It is represented by h(n), and it
calculates the cost of an optimal path between the pair of states. The value
of the heuristic function is always positive.
Admissibility of the heuristic function is given as: h(n) <= h*(n)
Here h(n) is heuristic cost, and h*(n) is the estimated cost. Hence heuristic cost
should be less than or equal to the estimated cost.
EXAMPLES: 1. Best First Search Algorithm(Greedy search), 2. A* Search Algorithm
Greedy best-first search algorithm always selects the path which appears best at that moment. It is
the combination of depth-first search and breadth-first search algorithms. It uses the heuristic
BEST-FIRST SEARCH function and search. Best-first search allows us to take the advantages of both algorithms. With the
help of best-first search, at each step, we can choose the most promising node. In the best first
ALGORITHM search algorithm, we expand the node which is closest to the goal node and the closest cost is
estimated by heuristic function, i.e.
f(n)= g(n).
Were, h(n)= estimated cost from node n to the goal.
The greedy best first algorithm is implemented by the priority queue.
BEST FIRST SEARCH ALGORITHM:
Step 1: Place the starting node into the OPEN list.
Step 2: If the OPEN list is empty, Stop and return failure.
Step 3: Remove the node n, from the OPEN list which has the lowest value of h(n), and places it in the
CLOSED list.
Step 4: Expand the node n, and generate the successors of node n.
Step 5: Check each successor of node n, and find whether any node is a goal node or not. If any
successor node is goal node, then return success and terminate the search, else proceed to Step 6.
Step 6: For each successor node, algorithm checks for evaluation function f(n), and then check if the
node has been in either OPEN or CLOSED list. If the node has not been in both list, then add it to the
OPEN list.
Step 7: Return to Step 2.
ADVANTAGES
Best first search can switch between BFS and DFS by gaining the advantages of both the algorithms.
BEST-FIRST SEARCH This algorithm is more efficient than BFS and DFS algorithms.

DIS-ADVANTAGES
It can behave as an unguided depth-first search in the worst case scenario.
ALGORITHM
It can get stuck in a loop as DFS.
This algorithm is not optimal.
EXAMPLE
Consider the below search problem, and we will traverse it using greedy best-first search. At each
iteration, each node is expanded using evaluation function f(n)=h(n) , which is given in the below table.

final solution path will be:


S----> B----->F----> G
GAME PLAY
Game Playing is an important domain of artificial
intelligence. Games don’t require much knowledge;
the only knowledge we need to provide is the rules,
legal moves and the conditions of winning or losing
the game.
Both players try to win the game. So, both of them try
to make the best move possible at each turn.
Searching techniques like BFS(Breadth First Search)
are not accurate for this as the branching factor is
very high, so searching will take a lot of time. So, we
need another search procedures that improve –
Generate procedure so that only good moves are
generated.
Test procedure so that the best move can be
explored first.
GAME THEORY
WHAT IS A GAME?
Game: In a general sense, a game comprises of a set of players, actions/strategies and the final payoff. Example:
Auction, Chess, Politics, etc.
WHAT IS GAME THEORY?
We define Game Theory as choosing from a set of rational choices in a multi-agent situation. In Game Theory, we
deal with deciding on a given set of options. An important thing to notice here is the phrase multi-agent situation. It
means our choice affects the choices of the opponent in the game, and their decision affects our choices. Von
Newman is credited for the invention of Game Theory.
TYPES OF GAMES
1. Zero-Sum and Non-Zero Sum Games 2. Simultaneous and Sequential Games 3. Imperfect Information and
Perfect Information Games 4. Asymmetric and Symmetric Games 5..Co-operative and Non-Co-operative Games
GAME THEORY
NASH EQUILIBRIUM:
Nash equilibrium can be considered the essence of Game Theory. It is basically a state, a point of equilibrium of
collaboration of multiple players in a game. Nash Equilibrium guarantees maximum profit to each player.
THE PRISONER’S DILEMMA
This game is a classic example and illustrates the difficulty of acting together cooperatively for common or mutual
benefit in scenarios where agents are only concerned about their self-interest.
In this game, we have two prisoners, Alan and Ben, who were caught for the same crime and are held in two different
interrogation rooms. They’ve been given two choices:
1. Stay silent Let’s say that each of them is given two
2. Confess to the crime choices. So, there would be 4 outcomes in
total:
{Silent, Silent}
{Confess, Silent}
{Silent, Confess}
{Confess, Confess}
GAME THEORY
THE PRISONER’S DILEMMA(CONT.)
1. If both of them remain silent, both of them get imprisonment for a year
2. If either one of them confesses, the confessor walks free and the other prisoner gets 15 years of imprisonment
3. If both of them confess, both of them receive imprisonment for 10 years

The dilemma comes in because neither prisoner is aware of what the other prisoner did. So, what do you think is the
Nash Equilibrium action in this problem? It is very intuitive to think that prisoners would collaborate with each other
and stay silent.
But then we also know that prisoners have evident self-interest in minimizing the imprisonment they receive. And
even if they remain silent, they still get imprisonment of a year each.
Let’s say that Ben also goes through the rational thought process as Alan. Ben also comes to the conclusion that no
matter what Alan chooses, he will always benefit from confessing. Now, if we superimpose the Rational thinking of
both these prisoners, the result is something like this:

And looking at the results, the best strategy comes out to


be {Confess, Confess}. Even if either of them tries to
deviate from this action, they are worse off than what
they are getting by playing this action.
Hence, {Confess, Confess} is a Nash Equilibrium strategy.
GAME THEORY IN ARTIFICIAL INTELLEGENCE
THE PRISONER’S DILEMMA(CONT.)
Game Theory, in terms of AI, basically helps in making decisions. This is not very difficult considering the fact that “Rationality”
is the foundation of Game Theory. As a matter of fact, Game Theory has already started establishing its place in Artificial
intelligence – can you guess where?
One such niche is the concept of Generative Adversarial Networks (GANs).

To answer that, we need to first understand the basics of GANs. A GAN


is a combination of two neural networks, namely:
Generator
Discriminator
A generator is a neural network that generates random images. On the
other hand, a Discriminator tries to classify whether the generated
image belongs to the given dataset or if it’s a generated image.

If the image is classified as “generated” or the fake image is caught by the discriminator, the Generator network adjusts its
parameters. On the other hand, if the “Discriminator” classifies the generated fake image as one from the dataset, then the
“Discriminator” adjusts its parameters.
This competitive process goes on until a state is reached where there is no more scope of improvement.
This state is called the “Nash Equilibrium”.
BOARD GAMES
Usually Two person games.
Zero Sum Game
One wins and other loses
Complete Information Games
Both can see the board
Alternate Moves are available
Deterministic
Luck is not involved
GAME TREE
A Layered Tree
Player Max and Min Choose
Alternatively

Square: Max
Circle: Min

W: Win
L: Loss
D: Draw
GAME TREE (CONT.)
MINIMAX BACKUP RULE
The leaves are labelled with the outcome of the
game.
When both players are rational the outcome of the
game is fixed
The minimax value is the outcome with both play
perfectly
Minimax value can be computed by applying the
minimax rule bottom up.
STRATEGIES
Strategies in a game tree are sub trees that
represents choices of one Player

COMPLEXITY OF THE GAME= SIZE OF THE GAME TREE


Tic-Tac-Toe: First player has a choice Chess: First player has a choice of 20
of 9 moves, second 8 and so on. moves, On avg 35 moves possible,
Total Possible steps=9 Game is 50 Moves long
IBMs DEEP BLUE beats World Total Possible steps= 35^50= 10^120
Chamipon in 1997
ALGORITHM MINIMAX
The most common search technique in game playing is
Minimax search procedure. It is depth-first depth-limited search
procedure. It is used for games like chess and tic-tac-toe.

Minimax algorithm uses two functions –

MOVEGEN : It generates all the possible moves that can be


generated from the current position.
STATICEVALUATION : It returns a value depending upon the
goodness from the viewpoint of two-player

This algorithm is a two player game, so we call the first player


as PLAYER1 and second player as PLAYER2. The value of each
node is backed-up from its children. For PLAYER1 the backed-
up value is the maximum value of its children and for PLAYER2
the backed-up value is the minimum value of its children. It
provides most promising move to PLAYER1, assuming that the
PLAYER2 has make the best move. It is a recursive algorithm, as
same procedure occurs at each level.
ALGORITHM MINIMAX

BEFORE BACKING-UP OF VALUES AFTER BACKING-UP OF VALUES


We assume that PLAYER1 will start the game. 4 levels are generated. The value to nodes H, I, J, K, L, M, N, O is
provided by STATICEVALUATION function. Level 3 is maximizing level, so all nodes of level 3 will take maximum
values of their children. Level 2 is minimizing level, so all its nodes will take minimum values of their children. This
process continues. The value of A is 23. That means A should choose C move to win.
PROBLEM DECOMPOSITION
Decomposition can be defined as the process of solving a
complex problem and breaking it into more sub-problems
that can be solved easily. Solving a complex problem may get
difficult sometimes but finding the solution for every sub-
problem will be simple after which the sub-problems can be
put together for finding the full solution to the original
problem.

IMPORTANCE OF DECOMPOSITION

1. It helps in solving complex problems easily.


2. The decomposed sub-tasks can be carried or solved by
different persons or a group of persons (if one is not
having enough knowledge about the full problem).
3. When the problem is divided into sub-tasks each sub-task
can be examined in detail.
MEANS ENDS
ANALYSIS(MEA)
A mixed strategy(solving problem from forward and backward), make it possible that first to solve the major
part of a problem and then go back and solve the small problems arise during combining the big parts of the
problem. Such a technique is called Means-Ends Analysis.
Means-Ends Analysis is problem-solving techniques used in Artificial intelligence for limiting search in AI
programs.
The MEA technique was first introduced in 1961 by Allen Newell, and Herbert A. Simon in their problem-
solving computer program, which was named as General Problem Solver (GPS).
The MEA analysis process centered on the evaluation of the difference between the current state and goal
state.

HOW MEANS-ENDS ANALYSIS WORKS:


Following are the main Steps which describes the working of MEA technique for solving a problem recursively.
First, evaluate the difference between Initial State and final State.
Select the various operators which can be applied for each difference.
Apply the operator at each difference, which reduces the difference between the current state and goal state.
MEANS ENDS
ANALYSIS(MEA)
OPERATOR SUBGOALING
In the MEA process, we detect the differences between the current state and goal state. Once these differences
occur, then we can apply an operator to reduce the differences. But sometimes it is possible that an operator
cannot be applied to the current state. So we create the subproblem of the current state, in which operator can be
applied, such type of backward chaining in which operators are selected, and then sub goals are set up to
establish the preconditions of the operator is called Operator Subgoaling.

Example of Mean-Ends Analysis:


Let's take an example where we know the initial state and goal state as given below. In this problem, we need to
get the goal state by finding differences between the initial state and goal state and applying operators.
MEANS ENDS
ANALYSIS(MEA)
SOLUTION:
To solve the above problem, we will first find the differences between initial states and goal states, and for each
difference, we will generate a new state and will apply the operators. The operators we have for this problem are:
Move
Delete
Expand
1. Evaluating the initial state: In the first step, we will evaluate the initial state and will compare the initial and
Goal state to find the differences between both states.
2. Applying Delete operator: As we can check the first difference is that in goal state there is no dot symbol which
is present in the initial state, so, first we will apply the Delete operator to remove this dot.
3. Applying Move Operator: After applying the Delete operator, the new state occurs which we will again compare
with goal state. After comparing these states, there is another difference that is the square is outside the circle, so,
we will apply the Move Operator.
4. Applying Expand Operator: Now a new state is generated in the third step, and we will compare this state with
the goal state. After comparing the states there is still one difference which is the size of the square, so, we will
apply Expand operator, and finally, it will generate the goal state.
MUTUAL EXCLUSION TWO ACTIONS A AND B ARE MUTEX IF ONE OF THE FOLLOWING HOLDS
1. If both actions have Competing Needs:
a. If the previous steps are Mutex
2. Inconsistent effects:
a. It affects one action positively and another action negatively.
3. Interference:
a. The previous action of one action is deleted by another action in current
step.
4. The same action deletes the previous action its own.
ALGORITHM GRAPH PLAN
THE PLANNING GRAPH
The planning graph is made up of following sets associated with each index i.
The set of actions Ai in the ith layer
The set of propositions pi in the ith layer
The set of positive effect link PostPi of actions in the ith layer.
The set of negative effect links PostNi of actions in the ith layer.
The set of preconditions links PrePi of actions in the ith layer from Pi-1
The set of actions mutexes in the ith layer
The set of proposition mutexes in the ith layer.
GROWING THE PLANNING GRAPH
It grows from left to right.
If two propositions are mutex in a level, it will be
mutex in all sub-sequent levels.
Likewise if two actions are non-mutex they will
continue to be same.
As graph grows more layers are added.
The number of propositions grows monotonically.
The number of actions grows monotonically.
No. of mutex grows from 0 then reduce later
GROWING THE PLANNING GRAPH
THE PROCESS OF EXTENDING THE GRAPH CONTINUES UNTIL ANYONE OF THE FOLLOWING TWO
CONDITION IS ACHIEVED
1. The newest proposition layer contains all the goal propositions, and there is no mutex relation
between any of the goal propositions.
2. The planning graph has levelled off. This means that for two consecutive levels.
a. If two consecutive levels have the same set of propositions with the same set of mutex relations
between them, it means that no new actions can make an appearance. Hence if the goal
propositions are not present in a levelled planning graph, they can never appear and the problem
has no solution.

WHEN THE GOALS ARE FOUND NON-MUTEX


1. It is possible, but not necessary, that a valid plan might exist in the graph
2. The algorithm regresses to a set o sub-goals that is non-mutex, and continues this process in a depth first fashion
3. If it cannot find a sub-goal set at some level searching backwards, it backtracks and tries another sub-goal set.
4. If it reaches the layer P0 at some point it returns the subgraph that is the shortest makespan plan.
5. else it extends the planning graph by one more level
a. this happnes till the planning graph has levelled off
KNOWLEDGE REPRESENTATION
AND REASONING
What does the agent know and what else does a agent know as a consequence of what it knows

THE SYLLOGISM
In a valid argument
The Greek Syllogism embodies the notion of formal logic.
An argument is valid if it conforms to a valid form IF the premises are True
THEN the conclusions are necessarily True
All men are mortal All cities are congested
Socrates is a man Delhi is a city
____________________ ___________________
Socrates is mortal Delhi is congested
KNOWLEDGE REPRESENTATION
AND REASONING
PROPOSITIONAL LOGIC FIRST ORDER LOGIC

If earth were spherical it would have cast curved shadow One of Tinker, Tailor, Soldier, or Spy is the culprit. The culprit
on the moon. It casts curved shadow on the moon. SO it stole the document. Tinker and Soldier did not steal the
must be spherical. document. If Tailor or Spy is the culprit, then document must
be in Paris.

Give the above facts show that the following sentence is true.

"The document is in Paris"


KNOWLEDGE REPRESENTATION
AND REASONING
DESCRIPTION LOGICS DEFAULT REASONING

A progressive high tech company is one with atleast five If Tweety is a bird then conclude that tweety can fly, because
women on its board of directors and one in which all the in general most birds fly.
employees have technical degrees and a salary of minimum
Rs. 100,000/- In real world agent has to come to conclusion with
incomplete information. Once they receive New Information,
A progressive high tech company IS a tech company. conclusion may change.
KNOWLEDGE REPRESENTATION
AND REASONING
EVENT CALCULUS EPISTEMIC REASONING

Jogesh made a cup of tea and kept it on a table. Meanwhile From the previous example, Jogesh knows that its Smita who
Smita saw the cup of tea and drank it. When Jogesh came had made the cup empty.
back he saw the cup was empty. Smita knows that Jogesh Knew she had drank the tea.

Reasoning about Time, action and change. Knowledge and Belief of agents.
FUZZY LOGIC & CONCEPTUAL
DEPENDENCY
FUZZY LOGIC
The term fuzzy refers to things that are not clear or are vague. In the real world
many times we encounter a situation when we can’t determine whether the state is
true or false, their fuzzy logic provides very valuable flexibility for reasoning. In this
way, we can consider the inaccuracies and uncertainties of any situation.

WHAT IS FUZZY CONTROL?

It is a technique to embody human-like thinkings into a control system.


It may not be designed to give accurate reasoning but it is designed to give
acceptable reasoning.
It can emulate human deductive thinking, that is, the process people use to
infer conclusions from what they know.
Any uncertainties can be easily dealt with the help of fuzzy logic.
FUZZY LOGIC ARCHITECTURE
RULE BASE INFERENCE ENGINE
It contains the set of rules and the IF-THEN conditions provided by the It determines the matching degree of the current fuzzy input
experts to govern the decision-making system, on the basis of linguistic with respect to each rule and decides which rules are to be
information. Recent developments in fuzzy theory offer several effective fired according to the input field. Next, the fired rules are
methods for the design and tuning of fuzzy controllers. Most of these combined to form the control actions.
developments reduce the number of fuzzy rules.

FUZZIFICATION
DEFUZZIFICATION
It is used to convert inputs i.e. crisp numbers into fuzzy sets. Crisp
It is used to convert the fuzzy sets obtained by the inference
inputs are basically the exact inputs measured by sensors and passed
engine into a crisp value. There are several defuzzification
into the control system for processing, such as temperature, pressure,
methods available and the best-suited one is used with a
rpm’s, etc.
specific expert system to reduce the error.
ADVANTAGES OF FUZZY LOGIC SYSTEM ADVANTAGES ,
This system can work with any type of inputs whether it is
imprecise, distorted or noisy input information. DISADVANTAGES &
The construction of Fuzzy Logic Systems is easy and
understandable. APPLICATIONS
Fuzzy logic comes with mathematical concepts of set theory
and the reasoning of that is quite simple.
APPLICATIONS OF FUZZY LOGIC SYSTEM
It provides a very efficient solution to complex problems in
It is used in the aerospace field for altitude control of spacecraft and
all fields of life as it resembles human reasoning and
satellites.
decision-making.
It has been used in the automotive system for speed control, traffic
The algorithms can be described with little data, so little
control.
memory is required.
It is used for decision-making support systems and personal
DIS-ADVANTAGES OF FUZZY LOGIC SYSTEM evaluation in the large company business.
Many researchers proposed different ways to solve a given It has application in the chemical industry for controlling the pH,
problem through fuzzy logic which leads to ambiguity. There drying, chemical distillation process.
is no systematic approach to solve a given problem through Fuzzy logic is used in Natural language processing and various
fuzzy logic. intensive applications in Artificial Intelligence.
Proof of its characteristics is difficult or impossible in most Fuzzy logic is extensively used in modern control systems such as
cases because every time we do not get a mathematical expert systems.
description of our approach. Fuzzy Logic is used with Neural Networks as it mimics how a person
As fuzzy logic works on precise as well as imprecise data so would make decisions, only much faster. It is done by Aggregation of
most of the time accuracy is compromised. data and changing it into more meaningful data by forming partial
truths as Fuzzy sets.
CONCEPTUAL DEPENDENCY THEORY CONCEPTUAL DEPENDENCY
THE CD theory defines a semantic base for natural lanugages
The Objective was to understand natural language stories.
The CD theory is designed for everyday actions.
More specific domains would require a specific set of primitives.
Basic Unit -> CONCEPTUALIZATION (something like a well formed formula)

Main Component -> EVENT (defined by an ACTOR, an ACTION, an OBJECT, a sense of direction)

CONCEPTUALIZATION= CONCEPT+ RELATIONS


Nominals and actions can exist as independent notions
Nominals stand for objects and people
Actions are acts of nominals
Modifiers give additional information on the nominals or actions.
A dependent concept predicts the existence of a governer.
A conceptualization is a collection of concepts and relations in which there is at least a two way dependency.
A conceptualization tells you something about the world.
Conceptual Dependency theory defines the set of actions that can be done by people.
Can be described in a logic like syntax
Can be depicted graphically by C-diagram.
CLUSTERING
A WAY OF GROUPING THE DATA POINTS INTO
DIFFERENT CLUSTERS, CONSISTING OF SIMILAR
DATA POINTS. THE OBJECTS WITH THE POSSIBLE
SIMILARITIES REMAIN IN A GROUP THAT HAS LESS
OR NO SIMILARITIES WITH ANOTHER GROUP
It does it by finding some similar patterns in the unlabelled
dataset such as shape, size, color, behavior, etc., and divides
them as per the presence and absence of those similar patterns.

It is an unsupervised learning method, hence no supervision is


provided to the algorithm, and it deals with the unlabeled
dataset.

The clustering technique is commonly used for statistical data


analysis.
DISTRIBUTION MODEL-BASED
TYPES OF CLUSTERING CLUSTERING

METHODS
In the distribution model-based clustering method, the
data is divided based on the probability of how a dataset
belongs to a particular distribution. The grouping is done
by assuming some distributions commonly Gaussian
Distribution.
PARTITIONING CLUSTERING
It is a type of clustering that divides the data into non-
HIERARCHICAL CLUSTERING
Hierarchical clustering can be used as an alternative for the
hierarchical groups. It is also known as the centroid-based
partitioned clustering as there is no requirement of pre-
method. The most common example of partitioning clustering is
specifying the number of clusters to be created. In this
the K-Means Clustering algorithm.
technique, the dataset is divided into clusters to create a
tree-like structure, which is also called a dendrogram. The
observations or any number of clusters can be selected by
DENSITY-BASED CLUSTERING cutting the tree at the correct level. The most common
The density-based clustering method connects the highly- example of this method is the Agglomerative Hierarchical
dense areas into clusters, and the arbitrarily shaped algorithm.
distributions are formed as long as the dense region can be
connected. This algorithm does it by identifying different FUZZY CLUSTERING
clusters in the dataset and connects the areas of high densities
Fuzzy clustering is a type of soft method in which a data
into clusters. The dense areas in data space are divided from
object may belong to more than one group or cluster. Each
each other by sparser areas.
dataset has a set of membership coefficients, which
depend on the degree of membership to be in a cluster.
Fuzzy C-means algorithm is the example of this type of
clustering; it is sometimes also known as the Fuzzy k-
means algorithm.
APPLICATIONS OF CLUSTERING
In Identification of Cancer Cells: The clustering algorithms are widely
used for the identification of cancerous cells. It divides the cancerous
and non-cancerous data sets into different groups.
In Search Engines: Search engines also work on the clustering technique.
The search result appears based on the closest object to the search
query. It does it by grouping similar data objects in one group that is far
from the other dissimilar objects. The accurate result of a query depends
on the quality of the clustering algorithm used.
Customer Segmentation: It is used in market research to segment the
customers based on their choice and preferences.
In Biology: It is used in the biology stream to classify different species of
plants and animals using the image recognition technique.
In Land Use: The clustering technique is used in identifying the area of
similar lands use in the GIS database. This can be very useful to find that
for what purpose the particular land should be used, that means for
which purpose it is more suitable.
CLASSIFICATION
The Classification algorithm is a Supervised Learning
technique that is used to identify the category of new
observations on the basis of training data. In
Classification, a program learns from the given dataset or
observations and then classifies new observation into a
number of classes or groups. Such as, Yes or No, 0 or 1,
Spam or Not Spam, cat or dog, etc. Classes can be called
as targets/labels or categories.
THE BEST EXAMPLE OF AN ML
CLASSIFICATION ALGORITHM IS EMAIL
SPAM DETECTOR.
The main goal of the Classification algorithm is to identify
the category of a given dataset, and these algorithms are
mainly used to predict the output for the categorical data.
CLASSIFIER
CLASSIFICATION
The algorithm which implements the classification on a dataset is
known as a classifier. There are two types of Classifications: ALGORITHMS
Binary Classifier: If the classification problem has only two possible
outcomes, then it is called as Binary Classifier.
Examples: YES or NO, MALE or FEMALE, SPAM or NOT SPAM, CAT
or DOG, etc.
Multi-class Classifier: If a classification problem has more than two TYPES OF ML CLASSIFICATION
outcomes, then it is called as Multi-class Classifier. ALGORITHMS:
Example: Classifications of types of crops, Classification of types of
music. Classification Algorithms can be further divided into the
Mainly two category:
USE CASES OF CLASSIFICATION ALGORITHMS Linear Models
Logistic Regression
Classification algorithms can be used in different places. Below are Support Vector Machines
some popular use cases of Classification Algorithms: Non-linear Models
Email Spam Detection K-Nearest Neighbours
Speech Recognition Kernel SVM
Identifications of Cancer tumor cells. Naïve Bayes
Drugs Classification Decision Tree Classification
Biometric Identification, etc. Random Forest Classification
Why use Decision Trees?

DECSION TREES
There are various algorithms in Machine learning, so choosing the
best algorithm for the given dataset and problem is the main point to
remember while creating a machine learning model. Below are the
Decision Tree is a Supervised learning technique that can be used for two reasons for using the Decision tree:
both classification and Regression problems, but mostly it is preferred Decision Trees usually mimic human thinking ability while making a
for solving Classification problems. It is a tree-structured classifier, decision, so it is easy to understand.
where internal nodes represent the features of a dataset, branches The logic behind the decision tree can be easily understood because it
represent the decision rules and each leaf node represents the shows a tree-like structure.
outcome.
In a Decision tree, there are two nodes, which are the Decision Node
and Leaf Node. Decision nodes are used to make any decision and
have multiple branches, whereas Leaf nodes are the output of those
decisions and do not contain any further branches.
The decisions or the test are performed on the basis of features of the
given dataset.
It is a graphical representation for getting all the possible solutions to
a problem/decision based on given conditions.
It is called a decision tree because, similar to a tree, it starts with the
root node, which expands on further branches and constructs a tree-
like structure.
In order to build a tree, we use the CART algorithm, which stands for
Classification and Regression Tree algorithm.
A decision tree simply asks a question, and based on the answer
(Yes/No), it further split the tree into subtrees.
DECISION TREE TERMINOLOGIES
Root Node: Root node is from where the decision tree starts. It DECISION TREE
represents the entire dataset, which further gets divided into two or
more homogeneous sets.
Leaf Node: Leaf nodes are the final output node, and the tree cannot
be segregated further after getting a leaf node.
Splitting: Splitting is the process of dividing the decision node/root
node into sub-nodes according to the given conditions.
Branch/Sub Tree: A tree formed by splitting the tree.
Pruning: Pruning is the process of removing the unwanted branches
from the tree.
Parent/Child node: The root node of the tree is called the parent
node, and other nodes are called the child nodes.
HOW IT WORKS?

Step-1: Begin the tree with the root node, says S, which contains the complete dataset.
Step-2: Find the best attribute in the dataset using Attribute Selection Measure (ASM).
Step-3: Divide the S into subsets that contains possible values for the best attributes.
Step-4: Generate the decision tree node, which contains the best attribute.
Step-5: Recursively make new decision trees using the subsets of the dataset created in step -3.
Continue this process until a stage is reached where you cannot further classify the nodes and
called the final node as a leaf node.
DECISION TREE
ADVANTAGES OF THE DECISION TREE DISADVANTAGES OF THE DECISION TREE
It is simple to understand as it follows the
The decision tree contains lots of layers,
same process which a human follow while
which makes it complex.
making any decision in real-life.
It may have an overfitting issue, which can
It can be very useful for solving decision-
be resolved using the Random Forest
related problems.
algorithm.
It helps to think about all the possible
For more class labels, the computational
outcomes for a problem.
complexity of the decision tree may
There is less requirement of data cleaning
increase.
compared to other algorithms.
ARTIFICIAL NEURAL NETWORK (ANN)
The term "Artificial neural network" refers to a biologically inspired sub-field of artificial intelligence modeled
NEURAL NETWORK after the brain. An Artificial neural network is usually a computational network based on biological neural
networks that construct the structure of the human brain. Similar to a human brain has neurons interconnected
to each other, artificial neural networks also have neurons that are linked to each other in various layers of the
networks. These neurons are known as nodes.

What is Artificial Neural Network?


The term "Artificial Neural Network" is derived from Biological neural networks that develop the structure of a
human brain. Similar to the human brain that has neurons interconnected to one another, artificial neural
networks also have neurons that are interconnected to one another in various layers of the networks. These
neurons are known as nodes.
ARCHITECTURE OF ANN
Input Layer:
As the name suggests, it accepts inputs in several different formats
NEURAL NETWORK
provided by the programmer.
Hidden Layer:
The hidden layer presents in-between input and output layers. It performs
all the calculations to find hidden features and patterns.
Output Layer:
The input goes through a series of transformations using the hidden layer,
which finally results in output that is conveyed using this layer.
The artificial neural network takes input and computes the weighted sum
of the inputs and includes a bias. This computation is represented in the
form of a transfer function.

It determines weighted total is passed as an input to an activation


function to produce the output. Activation functions choose whether a
node should fire or not. Only those who are fired make it to the output
layer.
There are distinctive activation functions available that can be applied
upon the sort of task we are performing.
TYPES OF ARTIFICIAL NEURAL NETWORK:

There are various types of Artificial Neural Networks (ANN) depending upon the human brain neuron and network
NEURAL NETWORK
functions, an artificial neural network similarly performs tasks. The majority of the artificial neural networks will have
some similarities with a more complex biological partner and are very effective at their expected tasks. For example,
segmentation or classification.

Feedback ANN:
In this type of ANN, the output returns into the network to accomplish the best-evolved results internally. As per the
University of Massachusetts, Lowell Centre for Atmospheric Research. The feedback networks feed information back
into itself and are well suited to solve optimization issues. The Internal system error corrections utilize feedback
ANNs.

Feed-Forward ANN:
A feed-forward network is a basic neural network comprising of an input layer, an output layer, and at least one layer
of a neuron. Through assessment of its output by reviewing its input, the intensity of the network can be noticed
based on group behavior of the associated neurons, and the output is decided. The primary advantage of this network
is that it figures out how to evaluate and recognize input patterns.
ADVANTAGES OF ANN DISADVANTAGES OF ANN
Parallel processing capability:
Artificial neural networks have a numerical value that can perform Assurance of proper network structure:
There is no particular guideline for determining the structure of
NEURAL NETWORK
more than one task simultaneously.
Storing data on the entire network: artificial neural networks. The appropriate network structure is
Data that is used in traditional programming is stored on the whole accomplished through experience, trial, and error.
network, not on a database. The disappearance of a couple of pieces Unrecognized behavior of the network:
of data in one place doesn't prevent the network from working. It is the most significant issue of ANN. When ANN produces a testing
Capability to work with incomplete knowledge: solution, it does not provide insight concerning why and how. It
After ANN training, the information may produce output even with decreases trust in the network.
inadequate data. The loss of performance here relies upon the Hardware dependence:
significance of missing data. Artificial neural networks need processors with parallel processing
Having a memory distribution: power, as per their structure. Therefore, the realization of the
For ANN is to be able to adapt, it is important to determine the equipment is dependent.
examples and to encourage the network according to the desired Difficulty of showing the issue to the network:
output by demonstrating these examples to the network. The ANNs can work with numerical data. Problems must be converted into
succession of the network is directly proportional to the chosen numerical values before being introduced to ANN. The presentation
instances, and if the event can't appear to the network in all its mechanism to be resolved here will directly impact the performance of
aspects, it can produce false output. the network. It relies on the user's abilities.
Having fault tolerance: The duration of the network is unknown:
Extortion of one or more cells of ANN does not prohibit it from The network is reduced to a specific value of the error, and this value
generating output, and this feature makes the network fault- does not give us optimum results.
tolerance.
THANK YOU

You might also like