0% found this document useful (0 votes)
44 views20 pages

P3 Practical

The document is a lab manual for the M.Sc. Cyber Security program at Narnarayan Shastri Institute of Technology, focusing on Artificial Intelligence Laboratory. It includes practical tasks on data manipulation, linear equations, machine learning concepts, and model evaluation techniques. Each practical section outlines objectives and tasks for students to complete during their semester.

Uploaded by

nfsunotess
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views20 pages

P3 Practical

The document is a lab manual for the M.Sc. Cyber Security program at Narnarayan Shastri Institute of Technology, focusing on Artificial Intelligence Laboratory. It includes practical tasks on data manipulation, linear equations, machine learning concepts, and model evaluation techniques. Each practical section outlines objectives and tasks for students to complete during their semester.

Uploaded by

nfsunotess
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Narnarayan Shastri Institute of Technology

Institute of Forensics Sciences and Cyber Security

M.Sc. Cyber Security


Semester - I (2024-25)

Lab Manual
Subject: Artificial Intelligence Laboratory

Subject Code: CTMSCS SI L3

Name: Falak Prajapati


Enrolment No. : 240043001020
CERTIFICATE

THIS IS TO CERTIFY THAT Mr./Ms. _________________________________________WITH

ENROLLMENT NO._____________________________ OF M.Sc. CYBER SECURITY, SEMESTER:

_______ YEAR 2024/25 HAS SATISFACTORILY COMPLETED THE LAB PRACTICAL WORK IN

ARTIFICIAL INTELLIGENCE LABORATORY (SUBJECT CODE: CTMSCS SI L3)

PLACE:
DATE OF SUBMISSION:

SIGNATURE
SIGNATURE
FACULTY
PRINCIPAL
INDEX

Sr. Title Page Signature


No. no.

1. Data Manipulation and Statistical Analysis 1

2. Solving Linear Equations Using Python 3

3. Working with Vectors and Matrices in Machine 4


Learning

4. Implementing Linear Regression from Scratch 6

5. Introduction to AI and Machine Learning 8

6. Data Preprocessing and Feature Engineering 10

7. Supervised Learning : Classification and 12


Regression

8. Unsupervised Learning: Clustering and 14


Dimensionality Reduction

9. Model Evaluation and Hyperparameter Tuning 16


Practical - 1. Data Manipulation and Statistical Analysis

Objective
Apply Python programming skills to manipulate data using lists, dictionaries,
and the pandas library. Perform statistical operations such as mean, median,
mode, standard deviation, and variance.

Tasks
1. Create a dictionary representing a dataset of students with their names,
ages, and scores. Convert it into a pandas DataFrame and display the
data.

2. Perform statistical analysis on the Score column:


• Mean
• Median
• Mode

1
• Standard deviation
• Variance

3. Visualize the distribution of Score using a histogram.

2
Practical - 2. Solving Linear Equations Using Python

Objective
Use Python and NumPy to solve a system of linear equations and understand
matrix operations.

Tasks
1. Represent the system of equations 2x + 3y = 5 and x − y = 1 as a matrix
equation Ax = b.
2. Solve for x and y using numpy.linalg.solve().
3. Verify the solution by substituting x and y back into the original
equations.

3
Practical - 3. Working with Vectors and Matrices in
Machine Learning

Objective
Understand and perform basic vector and matrix operations, foundational to
machine learning algorithms.

Tasks
1. Create vectors and perform:
• Dot product
• Element-wise addition
• Cross product

2. Create matrices and perform:

• Matrix multiplication
• Transpose
• Inverse (if invertible)

3. Compute eigenvalues and eigenvectors of a random 3 × 3 matrix.

4
5
Practical - 4. Implementing Linear Regression from
Scratch

Objective
Implement a simple linear regression algorithm using Python.

Tasks
1. Generate synthetic data for y = 2x + 1 with random noise.
2. Visualize the data using matplotlib.
3. Implement the linear regression formula:
θ = (XT X)−1XT y
4. Make predictions and evaluate using Mean Squared Error (MSE).

6
7
Practical - 5. Introduction to AI and Machine Learning

Objective
Understand the basic concepts of AI and ML, including definitions and types of
learning. Explore the applications of AI and ML in real-world scenarios.

Tasks
1. Research and Present AI Applications: List at least 5 applications of
AI and ML in different domains (e.g., healthcare, finance, transportation,
etc.). Write a brief explanation of how AI/ML is used in each
application.
2. Classify Types of Learning: Describe and compare supervised learning,
unsupervised learning, and reinforcement learning. For each type of
learning, provide a real-world example. Create a table summarizing the
types of learning.
3. Hands-on Task: Load a simple dataset (e.g., the Iris dataset) using scikit-
learn and visualize the features.

8
9
Practical - 6. Data Preprocessing and Feature Engineering
Tasks

Objective
Learn about data cleaning, feature selection, and feature normalization.

Task
1. Data Cleaning: Load a dataset (e.g., Titanic dataset from Kaggle). Check for
missing values and apply methods to handle them (e.g., fill with mean or drop
rows).

2. Feature Normalization: Normalize the numerical features using


MinMaxScaler or StandardScaler.

10
3. Feature Selection: Use correlation analysis or feature importance (e.g.,
decision trees) to select relevant features.

11
Practical – 7. Supervised Learning: Classification
and Regression
Objective
Apply supervised learning algorithms to classification and regression tasks.
Tasks.

Tasks
1. Regression with Linear Regression: Use the Boston Housing dataset
from scikit-learn to perform linear regression and predict house prices.
Evaluate the model using Mean Squared Error (MSE).

2. Classification with Logistic Regression: Use the Iris dataset for


classification with Logistic Regression. Evaluate the model using
accuracy and confusion matrix.

12
13
Practical - 8. Unsupervised Learning: Clustering
and Dimensionality Reduction
Objective
Implement unsupervised learning techniques like clustering and dimensionality
reduction.

Tasks
1. Clustering with K-Means: Apply K-Means clustering on the Iris dataset and
visualize the clusters.

14
2. Dimensionality Reduction with PCA: Apply Principal Component Analysis
(PCA) to reduce the dimensions of the Iris dataset and visualize it in 2D.

15
Practical - 9. Model Evaluation and
Hyperparameter Tuning

Objective
Evaluate models using cross-validation and tune hyperparameters for better
performance.

Tasks
1. Model Evaluation with Cross-Validation: Apply cross-validation to
evaluate the performance of a classification model (e.g., SVM or Random
Forest).

2. Hyperparameter Tuning with GridSearchCV: Use GridSearchCV to tune the


hyperparameters of an SVM classifier (e.g., C and gamma).

16
17

You might also like