CSE422_Notes
CSE422_Notes
Environments
1. Fully vs Partially observable: Fully observable environments are those where the agent
has all access to all relevant sensor information to make its desired choice. No need to keep the
internal state in memory. Eg: Chess,Tic Tac Toe,Ludo, 8 way puzzle
2. Single vs Multi Agent: Single Agent environment are those where only a single agent
interacts with the environment to make a positive change. For eg: Crossword, 8 Puzzle
5. Episodic vs Sequential: Episodic environments are those where the task performed now
has no effect on the next task. For eg: Supply chain robot, defect checking robot, Vacuum
Cleaner
6. Known vs Unknown: Known environments are those where the agent has full knowledge of
the environment.
Unknown environments are those where the agents DO NOT have full
knowledge about the environment.
The agent takes in input(percept) from an external environment using sensors and processes
inside processing modules and generates outputs with actuators which will bring about a
positive change in the environment which is calculated using performance measurement.
P: Customer Rating
E: Kitchen
A: Wheels, legs, Robotic arms
S: IR sensor, Camera
Search Engine:
The position of end state is NOT known The position of end state is known
Admissible Heuristics = Heuristics where all the estimated values are lower than actual cost to
reach the goal node from any nodes.
Fig: 3.1
A* Search:
● f(n) = g(n) + h(n). g(n) is the UCS part and h(n) is the greedy best first search part .
● It is a combination of uninformed search(UCS) and informed search(best first search)
● If all g(n) = 0 A* acts like greedy best first search, and if all h(n) = 0 its acts like UCS
● Time complexity: b^d
● Space complexity: b^d
● Complete. If there is infinite loop, path cost will increase to a point another branch has
lower cost
● Optimal if heuristic admissible. If not admissible then not optimal.
Week 04(Local Search)
In uninformed and informed search, we had to keep track of the parent for each of the nodes, so
we could actually see the path the algo took to reach the goal. This takes up a lot of memory.
But sometimes we do not require the way we reached the solution but just the solution itself. So
point in keeping the nodes in memory. In comes Local Search. For eg: 8 queen problem,
Hill Climbing
● Does not maintain a search tree. Only remembers the value of the current node and
value of the object function.
● Does not look beyond the immediate neighbours of the current node just like going
through a fog on a hill with amnesia.
● Also called greedy local search as it takes the immediate better state in sight(ie
neighbour) not thinking what's ahead.
Problems regarding Hill climbing
Local Maxima = When we are at point A and we go to the nearest neighbour ie B we have to move
right and go uphill to B(h increases) from B if we move right we go to C which is downhill (h decreases).
So from B if we move either way our h decreases meaning we will be moving away from our goal if we
move from B thus making B our peak. But we can see our maximum peak is at F which is our global
maxima and B is our local maxima
Plateau = If we move towards J from left and keep moving towards right our h value does not change
hinting. We know we move forward if we get lower value. Here at J, we have no idea of where to go so
this is known as PLATEAUX
Ridges = If the local maxima is really close to one another we get this problem. If we move right to M,
we are moving uphill, now if we move right to N, we are moving downhill, then further right on O we are
moving uphill and moving right to P, we are moving downhill.
How to resolve the drawbacks of Hill Climbing
Week 05+06(Constraint Satisfaction Problem)
It is a type of configuration search. In configuration search the path taken to reach a goal is not
important rather we need to make sure we reach the goal.
Backtracking means there will be many unwanted states we visited. We can improve our search
by
Forward Checking
If we use normal backtracking we will have to color a lot of other nodes before we reach a dead
state so in backtracking there are a number of useless states.
Arc Consistency
In step 2. Green is assigned to V. Now we remove G from legal values of SA and NSW. Now
we are left with B in SA. So we remove B from SA’s adjacent nodes. So B is removed from legal
values of NT,Q and NSW. Then G is left in NT and Q so as they are adjacent so we have hit a
dead end.
Ordering Heuristics
1. Most constrained variable- Also known as Minimum remaining values(MRV). An unassigned
variable with the least number of legal values.(possible variable domain).
2. Most constraining variable- Also known as Degree heuristic. The variable with the most
constraint on remaining variables. That is the variable with the most number of
connected(neighbouring) unassigned variables.
3. Least constraining value- Choose the value for an unassigned variable which rules out the
least number of values for the remaining connected variables.
First we choose a Most Constrained Variable, if there is a tie we choose a most constraining
variable. If there is a tie again we choose one of the tied variables randomly and give the Least
constraining value to it(if possible). Still there might be a chance of a dead end.
NB: If we have a node which is isolated or not connected to any other nodes, then we will
choose at the very end.
Week 07(Probability)
Independence
Joint Probability Table for 3 Variables
Week 08.1(Bayes Theorem)
Confusion Matrix
-A = negative of A
Precision = The ratio of actual positive from the total predicted positive.
=
Basic Of Bayes Theorem
Week 08.2(Naive Bayes)
“Naive” Bayes is Bayes Theorem with the conditional independence when multiple variables are
present for the given part.
Here Getting A^B^C is a tough task as the data set needs to be huge so there is a chance we
might get zero as the probability, so we ASSUME conditional independence.
Q) What is the problem with Bayes theorem? How can we solve that?
A) Let's say we want to find the probability of P(A^B^C | D). Now we need to have a huge
dataset(2^4 unique row combinations) to get the correct combination of A,B,C,D otherwise we
end up with a probability of zero. For this reason we use Naive Bayes because it assumes the
conditional independence so instead of P(A^B^C | D) we get P(A|D)P(B|D)P(C|D). In this case
the chances of getting a zero value of probability from the combination is far LOWER than the
previous case.
Q) Why is Naive Bayes called “Naive”? /Why can Naive Bayes not be used in the real world?
A) In naive Bayes we assume conditional independence of the feature variables for the real
world scenarios. In the real world the feature variables are not always conditionally independent
of one another, so this approach is called ‘Naive’’ as it is an assumption.