C073 AI Assignment2
C073 AI Assignment2
Solving Techniques:
Local Search Techniques: These involve starting with an initial solution and
iteratively improving it by making local changes. Techniques like hill climbing or
simulated annealing can be used.
Example: In a scheduling problem, a local search may start with an initial schedule
and iteratively swap tasks between two time slots to reduce conflicts.
Efficiency Improvements:
Variable Ordering: Selecting the order in which variables are assigned can
significantly impact efficiency. Choosing the most constrained variable (the one
with the fewest legal values) first can lead to quicker failures and less backtracking.
Value Ordering: Prioritizing values that are likely to lead to a solution can also
enhance efficiency. Using heuristics, like trying the least constraining values first,
can help.
Definition and Types of Learning: Inductive learning involves inferring general principles
from specific examples. Common types include:
Example: Consider a dataset predicting whether a person buys a product based on age and
income. A simple decision tree might have:
K-Means Clustering is an unsupervised learning algorithm used to group data points into a
predefined number of clusters (K). The main objective is to partition the dataset into K
clusters, where each data point belongs to the cluster with the nearest mean (centroid),
minimizing the variance within each cluster.
1. Initialization:
o Select K initial centroids randomly from the dataset.
2. Assignment Step:
o Assign each data point to the nearest centroid based on the Euclidean
distance.
3. Update Step:
o Calculate the new centroids by taking the mean of all data points assigned to
each centroid.
4. Convergence Check:
o Check if the centroids have changed. If they have not changed significantly
(or a maximum number of iterations is reached), the algorithm converges and
stops; otherwise, repeat steps 2 and 3.
Dataset: Consider a simple dataset of points representing customers based on their spending
and income.
Steps:
1. Initialization: Randomly select K=2 centroids. For example, (15,000, 500) and
(35,000, 1,500).
2. Assignment:
o Assign each customer to the nearest centroid.
3. Update:
o Calculate new centroids:
Centroid 1: Mean of points assigned to it.
Centroid 2: Mean of points assigned to it.
After several iterations, you might end up with two clusters of customers based on their
income and spending habits, which can be used for targeted marketing strategies.
1. Knowledge Base:
o Contains domain-specific knowledge, facts, and rules. It is the
core of the expert system.
2. Inference Engine:
o The processing unit that applies logical rules to the knowledge
base to deduce new information or make decisions.
3. User Interface:
o The means through which users interact with the expert system. It
allows users to input data and receive advice or recommendations.
4. Explanation Facility:
o Provides users with insights into the reasoning process of the
system, explaining how conclusions were reached.
Real-World Applications: