0% found this document useful (0 votes)
68 views19 pages

AI&ML Lab Report

This lab report summarizes work done on artificial intelligence and machine learning problems. It includes implementations of algorithms like FIND-S, water jug problem using DFS, 8 puzzle problem using A*, linear and polynomial regression, ID3 decision tree, SVM with RBF kernels, backpropagation neural network, EM and k-means clustering, k-nearest neighbors classification, and Gaussian kernel transformation of 2D data to 3D. Output and plots from running the Python code are also included.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views19 pages

AI&ML Lab Report

This lab report summarizes work done on artificial intelligence and machine learning problems. It includes implementations of algorithms like FIND-S, water jug problem using DFS, 8 puzzle problem using A*, linear and polynomial regression, ID3 decision tree, SVM with RBF kernels, backpropagation neural network, EM and k-means clustering, k-nearest neighbors classification, and Gaussian kernel transformation of 2D data to 3D. Output and plots from running the Python code are also included.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Jashore University of Science and Technology

Department of Computer Science and Engineering


Course Code: CSE 3202
Course Title: Artificial Intelligence and Machine Learning Lab

Lab Report on: AI & ML

Submitted to Submitted by
Md. Yasir Arafat Md. Mahabub Alam
Assistant Professor Student ID: 190149
3rd year 2nd semester

Dept. of Computer Science and Engineering Dept. of Computer Science and Engineering.
Jashore University of Science and Jashore University of Science and
Technology Technology

Remarks:

Date of Submission: 27/12/23


Artificial Intelligence Problems
1. Implement and demonstrate the FIND-S algorithm for finding the most specific
hypothesis based on a given set of training data samples. Read the training data from a
.CSV file

The FIND-S algorithm is a concept learning algorithm that finds the most specific hypothesis
that is consistent with the training data.
Let's assume the training data consists of binary attributes and a target attribute. The hypothesis
will be represented as a list of attribute values.
Here's a simple implementation:

This code reads the CSV file, initializes the hypothesis to None, and then iterates through each
row in the dataset. If the target attribute is 1, it updates the hypothesis. If the target attribute is 0,
it ignores that row.
2. Write a program in python to implement water jug problem using DFS algorithm
The water jug problem is a classic problem in artificial intelligence and graph theory. Here's a
simple implementation in Python using the Depth-First Search (DFS) algorithm:
Implementation:

Output:
3. Write a program in python to solve 8 puzzle problem using A* algorithm

Solving the 8-puzzle problem using the A* algorithm involves defining a state representation, a
heuristic function, and implementing the A* search algorithm. Here's a simple implementation in
Python:
Implementation:
Output :
Machine Learning Problems
1. Draw and demonstrate linear regression and polynomial regression line using python for
a given datasets.

Implementation:

Output:
2. Write a program to demonstrate the working of the decision tree based ID3 algorithm.
Use an appropriate data set for building the decision tree and apply this knowledge to
classify a new sample
Implementation:
Output:
3. Classifying Data Using Support Vector Machines (SVMS): SVM-RBF Kernels. Plot
the dataset and predicted value using matplotlib.
Implementation:

Output:
4. Build an Artificial Neural Network by implementing the Backpropagation algorithm and
test the same using appropriate data sets. (AND Gate or XOR gate or any other examples).
Implementation:
Output:
5. Apply EM algorithm to cluster a set of data stored in a .CSV file. Use the same data set
for clustering using k-Means algorithm. Compare the results of these two algorithms and
comment on the quality of clustering. You can add Python ML library classes/API in the
program.
Implementation:
Output:

6. Write a program to implement k-Nearest Neighbor algorithm to classify the iris data set.
Print both correct and wrong predictions. Python ML library classes can be used for this
problem.
Implementation:

Output:
7. Show that how your script run on a GPU. Create an object representing a GPU device,
move a tensor from CPU to GPU or directly creating a tensor on GPU and run all
functions and methods on GPU tensor. (show the utilization of GPU in your scripts).
Implementation:

Output:
8. We are given the following two-dimensional data points for a binary classification
problem: A nonlinear transformation is used to transform the input vector Load the above
dataset. Create a scatter plot. Apply a Gaussian kernel function and
transform the data into 3D. Create a 3D scatter plot and observe the change.
Implementation:

Output:

You might also like