Lab 1
Create a base class Vehicle that will have:
Attributes: make, model, year.
Method display_info that prints out basic information about the vehicle.
Create two derived classes from Vehicle:
Car: In addition to the base class attributes, a car has an attribute num_doors (number
of doors).
Motorcycle: In addition to the base class attributes, a motorcycle has an attribute
has_sidecar (whether it has a sidecar or not).
Both Car and Motorcycle should override the display_info method to include their specific
details (like number of doors or sidecar).
Use encapsulation by making some attributes private, and provide getter and setter methods to
access or modify them.
Use Polymorphism to create a show_vehicle_info function that takes any vehicle (either car or
motorcycle) and calls its display_info method.
Lab 2
Smoke Detection System
Design and implementation of a simple reflex agent that detects smoke and triggers an alert.
The agent will operate based on a set of condition-action rules, responding to the presence of
smoke in the environment
Project Management
Create a goal-based agent that manages tasks in a project management system, ensuring that
tasks are completed in a prioritized manner to meet project deadlines.
Lab 3
1. Run BFS with various initial board configurations. Record the number of nodes
expanded and the number of moves taken to reach the goal.
2. Identify an initial board configuration for which BFS fails to find a solution. Record the
total number of nodes expanded in this case.
3. Modify the PuzzleState class to support custom goal states, allowing different puzzles to
have different goals.
4. In addition to tracking node expansion and move count, also record the total number of
nodes visited to reach the goal.
Lab 4
Open the provided notebook, start working with the given code setup.
1. Create different mazes, Try various maze sizes (e.g., 5x5).
2. Uncomment visualization code, Enable maze display to see the structure.
3. Identify the mistake in computing path length.
4. Add walls to the maze, Modify the maze to include walls or obstacles.
5. Update UCS for weighted graphs, Add edge weights to your graph and modify UCS to
use them for cost-based pathfinding.
6. Summarize your observations and insights based on the results of this experiment
Lab 5
Open the provided notebook, start working with the given code setup.
1. Run different experiments on DLS and record the output.
1. Change start/goal nodes
2. Change Limit
3. Try various graphs
2. Implement IDS by calling DLS iteratively using different limits.
3. Compare the search patterns (expansion) of both algorithm on a fresh graph.
Lab 6
Proposal Submission - OEL
Lab 7
Open the provided notebook, start working with the given code setup.
1. Run multiple experiments by modifying the following settings twice, and compare and
analyze the performance of both algorithms in each case:
1. The initial state of the puzzle.
2. The goal state of the puzzle.
2. Modify the A* algorithm to use a new heuristic: Misplaced Tiles (count no. of tiles out of
place), and compare its performance with Manhattan Distance.
3. Add a new function for Uniform Cost Search which works as follows
f(n) = g(n)
Can we apply UCS to 8-puzzle problem? How cost will be defined.
Lab 8
Open the provided notebook, start working with the given code setup.
1. Run hill climbing algorithm 10 times and analyze the performance of the algorithm. How
many times, was it able to generate the Solution.
2. Use the function plot_fitness(fitness_values) to show performance of the Hill Climbing
Algorithm.
3. Run Genetic Algorithm, with parameter tuning. What values of max_generations,
population_size gives solution more frequently.
4. Use the function plot_fitness(fitness_values) to show performance of the Genetic
Algorithm.
Lab 9
Open the provided notebook, start working with the given code setup.
1. Upload lab_9_height_category_dataset.csv file and execute the python code.
2. Run two different experiments by changing the fuzziness of the system, consider
outcome of experiment as two different sets (A & B). Plot set A and B.
3. Apply Union and Intersection on A & B sets. The result of these operations should be
saved as a column in dataframe.
4. Take Complement of Set A and save it as a column in dataframe.
5. Calculate the support, core and height of set B.
Lab 10
Open the provided notebook, start working with the given code setup.
1. Modify the code to display a side-by-side comparison of actual vs. predicted labels.
Message Expected Predicted
Win a Car! spam spam
Going for a walk. ham spam
2. Create a plot that visualizes the predicted and actual classifications for each message.
3. Experiment with different train-test split ratios and observe how it affects model
performance. Record the resulting Confusion Matrix, Accuracy, Recall, and Precision.
4. Find a real-world dataset suitable for Naive Bayes classification, replace the existing
dataset in your code, run the same pipeline, and document your observations and
results.