FAI Unit2
FAI Unit2
Introduction
Artificial Intelligence is the study of building agents that act rationally. Most of
the time, these agents perform some kind of search algorithm in the
background in order to achieve their tasks.
Other Terminology,
The Solution to a search problem is a sequence of actions, called the plan that
transforms the start state to the goal state.
1. Random Search
How It Works:
Grid Representation:
[S] - - - -
- X---
- - - -
- - - [T]
This method lacks efficiency since the explorer does not use prior knowledge of
the map.
Pros:
Simple to implement.
Can explore unconventional solutions.
Useful when no domain knowledge is available.
Cons:
How It Works:
The algorithm starts by adding the initial node to the open list.
A node is picked from the open list, expanded, and moved to the closed
list.
The process continues until the goal is found or no nodes remain in the
open list.
In a maze-solving problem, the open list contains unexplored junctions, while the
closed list maintains visited paths, preventing backtracking.
Maze Representation:
[S] - [O] - [T]
- [O] - [X]
- [X] - [X]
- - - -
Pros:
Cons:
How It Works:
The algorithm starts at the root node.
It explores a path as deep as possible before backtracking.
If a dead-end is reached, the algorithm backtracks to the previous node.
Consider a tree structure where DFS explores a branch deeply before moving to
another branch.
(A)
/ \
(B) (C)
/ \ \
(D) (E) (F)
DFS traversal: A → B → D → E → C → F
Pros:
Cons:
Example:
BFS explores all neighboring nodes before moving to the next level.
How It Works:
(A)
/ \
(B) (C)
/ \ \
(D) (E) (F)
BFS traversal: A → B → C → D → E → F
Pros:
Cons:
Example :
How It Works:
Here, A* chooses paths based on f(n) = g(n) + h(n), where g(n) is the path cost
and h(n) is the heuristic estimate.
Examples:
Pros:
Cons:
Different search strategies have their advantages and drawbacks. The choice of
algorithm depends on the problem constraints such as memory, execution time,
and the nature of the solution space.
Each approach is suitable for specific applications, such as path finding, game AI,
and decision-making systems. Selecting the right algorithm is crucial for solving
problems efficiently.
Overview
Support Vector Machine (SVM) is a supervised learning algorithm primarily used for
classification and regression tasks. It finds an optimal hyperplane that best separates
different classes in a dataset.
Key Concepts
Support Vectors: Data points closest to the hyperplane, which influence its
position and orientation.
Margin: The distance between the hyperplane and the nearest data points
from either class. SVM aims to maximize this margin.
Types of SVM
SVM analyzes features like word frequency and classifies emails into these two
categories by finding the optimal hyperplane that best separates them.
Overview
Key Concepts
Variance: A measure of data spread. PCA seeks to retain the most significant
variations.
Example
Consider a dataset with multiple features (e.g., customer purchasing behavior across
multiple products). PCA reduces the dimensions to a few principal components,
allowing for easier visualization and efficient model training.
Conclusion
SVM is a powerful classification tool that finds an optimal hyperplane for separating
data, while PCA is useful for reducing data complexity while retaining essential
features. Combining these techniques can lead to more efficient and effective AI
models.