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

Practical File

This document is a practical report file for the subject of Artificial Intelligence for the academic session 2025-26, submitted by a student to their teacher. It includes an acknowledgment section, an index of various Python programming tasks related to data analysis and visualization, and a data storytelling project focused on the impact of the Mid-Day Meal Scheme on student dropout rates. The report outlines specific programming exercises and a structured approach to analyzing educational data.

Uploaded by

Maan Singh
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)
7 views20 pages

Practical File

This document is a practical report file for the subject of Artificial Intelligence for the academic session 2025-26, submitted by a student to their teacher. It includes an acknowledgment section, an index of various Python programming tasks related to data analysis and visualization, and a data storytelling project focused on the impact of the Mid-Day Meal Scheme on student dropout rates. The report outlines specific programming exercises and a structured approach to analyzing educational data.

Uploaded by

Maan Singh
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

Session

2025-26

Practical File
Subject: Artificial
Intelligence (843)

Student Name:
Roll No:
Class & Sec: XII
DELHI WORLD PUBLIC
SCHOOL, Dadri, [Link]

Practical Report File


Subject: Artificial Intelligence
(843)

Session: 2025-26

Submitted By Submitted To
Student Name: Teacher Name: Mr. Maan Singh
(PGT I.P.)
Roll No:
Class & Sec: XII
AISSCE (CLASS XII) Practical Examination in

Artificial Intelligence

Session 2025-26

ACKNOWLEDGEMENT
I would like to express my special thanks of gratitude to my Artificial
Intelligence teacher Mr. Maan Singh, as well as our Principal, Mrs.
Ratna Verma for providing me with the opportunity to work on this
beautiful project.

Secondly, I would also like to thank my parents and friends who


helped me to complete this project within the limited time frame.

Finally, I would like to thank everyone without whose help I could


not have completed my project successfully.

Name :
Class : XII
Roll No:
INDEX
[Link]. TOPIC PAGE SIGNATURE
NO
Unit 1: Capstone Project
1 Write a python program to show Decompose Time Series Data into Trend.

2 Write a python program for Training and Test Data in Python Machine
Learning.
3 Write python program to calculate Mean Absolute Error for given dataset.

4 Write python program to calculate Root Mean Absolute Error for given
dataset.

5 Write python program to calculate Mean Squared Error for given dataset.
6 WAP to check given year is a leap year.

7 WAP in python to print sum of ten natural numbers.

8 WAP in python to print column graph for five subject performances of a


student.
9 WAP in python to create a basic histogram in Matplotlib of some random
values.

10 WAP in python to Draw a line in a diagram from position (1, 3) to (2, 8)


then to (6, 1) and finally to position (8, 10)
11 WAP in python to draw two scatter plots on the same figure for age verses
speed of cycling.
12 WAP in python to plot bar graph for four cricket teams and their highest
score in T-20 match. Use different colour for different team.
13 WAP in python to plot pie chart for five fruits and their quantity in basket
and pull the "Apples" wedge 0.2 from the center of the pie.
14 WAP to read data from CSV file and print top and bottom record using
head () and tail () from dataset.
15 WAP in python with Pyplot,, use the grid() function to add grid lines to the
plot.
Unit 1
Capstone Project-
Python Program(s)

Q1. Write a python program to show Decompose Time Series Data into Trend.

Source Code:

from random import randrange


from pandas import Series
from matplotlib import pyplot
from [Link] import seasonal_decompose
series = [i+randrange(10) for i in range(1,100)]
result = seasonal_decompose(series, model='additive', period=1)
[Link]()
[Link]()
Output:
Q2. Write a python program for Training and Test Data in Python Machine Learning.
Source Code:
# Import necessary libraries
import pandas as pd
from sklearn.model_selection import train_test_split

# Sample dataset: You can replace this with your actual data
# Creating a simple dataset
data = {
'Feature1': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
'Feature2': [11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
'Target': [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]
}

# Convert the dictionary into a DataFrame


df = [Link](data)

# Separate features (X) and target variable (y)


X = df[['Feature1', 'Feature2']] # Features
y = df['Target'] # Target variable

# Split the dataset into training and testing sets


# test_size=0.2 means 20% of the data will be used for testing, 80% for training
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Display the results


print("Training Features:\n", X_train)
print("\nTraining Target:\n", y_train)
print("\nTesting Features:\n", X_test)
print("\nTesting Target:\n", y_test)
Output:
Feature1 Feature2
5 6 16
0 1 11
7 8 18
2 3 13
9 10 20
4 5 15
3 4 14
6 7 17,

Featur e1 Feature2
8 9 19
1 2 12,
5 1
0 0
7 1
2 0
9 1
4 0
3 1
6 0

Name: Target, dtype: int64,


8 0
1 1
Name: Target, dtype: int64)
Q3. Write python program to calculate Mean Absolute Error for given dataset.
Source Output:
from [Link] import mean_absolute_error
import numpy as np

# Generate some sample data


y_true = [Link]([1, 2, 3, 4, 5])
y_pred = [Link]([1.5, 2.5, 2.8, 4.2, 4.9])

# Calculate the MAE


mae = mean_absolute_error(y_true, y_pred)
print("Mean Absolute Error:", mae)

Output:
Mean Absolute Error : 0.3
Q4. Write python program to calculate Root Mean Absolute Error for given dataset
Source Code:

import numpy as np
def calculate_rmae(predictions, actuals):

predictions (list or numpy array): The predicted values.


actuals (list or numpy array): The actual values.

Returns:
float: The RMAE value.

predictions = [Link](predictions)
actuals = [Link](actuals)
if len(predictions) != len(actuals):
raise ValueError("The length of predictions and actuals must be the same.")
absolute_errors = [Link](predictions - actuals)
mean_absolute_error = [Link](absolute_errors)
rmae = [Link](mean_absolute_error)

return rmae
predictions = [3.2, 2.8, 4.1, 5.0]
actuals = [3.0, 2.5, 4.0, 5.2]

rmae = calculate_rmae(predictions, actuals)


print(f"Root Mean Absolute Error (RMAE): {rmae:.4f}")

Output:
Root Mean Absolute Error: 0.4472
Q5. Write python program to calculate Mean Squared Error for given dataset
Source Code:

# import necessary libraries


import pandas as pd
import numpy as np

# define your series


y_true = [Link]([1, 2, 3, 4, 5])
y_pred = [Link]([1.5, 2.5, 3.5, 4.5, 5.5])

# use mean() and square() methods


result = [Link]([Link](y_true - y_pred))

# print the result


print(f'MSE: {result}')

Output:
Mse: 0.25

Q6. WAP to check given year is a leap year.


Source Code:
def CheckLeap(Year):
# Checking if the given year is leap year
if((Year % 400 == 0) or (Year % 100 != 0) and (Year % 4 == 0)):
print("Yes! This Year is a leap Year");
# Else it is not a leap year
else:
print ("This Year is not a leap Year")
# Taking an input year from user
Year = int(input("Enter the number here: "))
# Printing result
CheckLeap(Year)

Output:
Enter the number here: 1700
Yes! This Year is a leap Year
Q7. WAP in python to print sum of ten natural numbers.

Source Code:

# Initialize the sum to 0

total_sum = 0

# Loop through the first 10 natural numbers (1 to 10)

for number in range(1, 11):

total_sum += number # Add each number to the total sum

# Print the result

print("The sum of the first 10 natural numbers is:", total_sum)

Output:

The sum of the first 10 natural numbers is: 55


Q8. WAP in python to print column graph for five subject performances of a student.
Source Code:

import [Link] as plt

subject = ['Physic','Chemistry', 'Biology','Maths','English']

percentage =[85,78,89,95,100]

[Link](subject,percentage)

[Link]('Analyse Performance of Student on Subject Wise')

[Link]('Subject')

[Link]('Percentage of Students passed')

[Link]()

Output:
Q9. WAP in python to create a basic histogram in Matplotlib of some random values.

Source Code:

import [Link] as plt

import numpy as np

# Generate random data for the histogram

data = [Link](1000)

# Plotting a basic histogram

[Link](data, bins=30, color='skyblue', edgecolor='black')

# Adding labels and title

[Link]('Values')

[Link]('Frequency')

[Link]('Basic Histogram')

# Display the plot

[Link]()

Output:
Q10. WAP in python to Draw a line in a diagram from position (1, 3) to (2, 8) then to (6, 1) and
finally to position (8, 10)
Source Code:

import [Link] as plt

import numpy as np

xpoints = [Link]([1, 2, 6, 8])

ypoints = [Link]([3, 8, 1, 10])

[Link](xpoints, ypoints)

[Link]()

Output:
Q11. WAP in python to draw two plots on the same figure for age verses speed of cycling.

Source Code:

import [Link] as plt


import numpy as np

#day one, the age and speed of 13 cycles:


x = [Link]([5,7,8,7,2,17,2,9,4,11,12,9,6])
y = [Link]([99,86,87,88,111,86,103,87,94,78,77,85,86])
[Link](x, y)

#day two, the age and speed of 15 cycles:


x = [Link]([2,2,8,1,15,8,12,9,7,3,11,4,7,14,12])
y = [Link]([100,105,84,105,90,99,90,95,94,100,79,112,91,80,85])
[Link](x, y)

[Link]()

Output:
Q12. WAP in python to plot bar graph for four cricket teams and their highest score in T-20
match. Use different colour for different team.
Source Code:
import [Link] as plt

# Data for the bar graph

teams = ['India', 'Pakistan', 'England', 'New Zealand']

scores = [210, 100, 170, 140]

# Colors for different teams

colors = ['blue', 'green', 'yellow', 'purple']

# Create the bar graph

[Link](figsize=(10, 6))

[Link](teams, scores, color=colors)

# Add titles and labels

[Link]('Highest Scores in T20 Matches')

[Link]('Teams')

[Link]('Highest Score')

[Link](0, max(scores) + 20)

# Show the bar graph

[Link]()

Output:
Q13. WAP in python to plot pie chart for five fruits and their quantity in basket and Pull the
"Apples" wedge 0.2 from the center of the pie.
Source Code:

import [Link] as plt


import numpy as np

y = [Link]([35, 25, 25, 15])


mylabels = ["Apples", "Bananas", "Cherries", "Dates"]
myexplode = [0.2, 0, 0, 0]

[Link](y, labels = mylabels, explode = myexplode)


[Link]()

Output:
Q14. WAP to read data from CSV file and print top and bottom record using head () and tail ()
from dataset.
Source Code:

import pandas as pd

# Replace 'your_file.csv' with the path to your CSV file


file_path = 'your_file.csv'

# Read the CSV file


df = pd.read_csv(file_path)

# Print the first 5 rows using head


print("First 5 rows:")
print([Link]())

# Print the last 5 rows using tail


print("\nLast 5 rows:")
print([Link]())

Output:
First 5 rows:

ID Name Age Department

0 1 John Doe 28 Sales

1 2 Jane Smith 34 Marketing

2 3 Bob Johnson 45 IT

3 4 Emily Davis 29 HR

4 5 Michael Brown 41 Finance

Last 5 rows:

ID Name Age Department

5 6 Linda White 37 Marketing

6 7 Chris Green 30 IT

7 8 Alice Black 26 Sales

8 9 Mark Wood 38 Finance

9 10 Olivia Lee 33 HR
Q15. WAP in python with Pyplot, use the grid() function to add grid lines to the plot.

Source Code:
import numpy as np
import [Link] as plt

x = [Link]([80, 85, 90, 95, 100, 105, 110, 115, 120, 125])
y = [Link]([240, 250, 260, 270, 280, 290, 300, 310, 320, 330])

[Link]("Sports Watch Data")


[Link]("Average Pulse")
[Link]("Calorie Burnage")

[Link](x, y)

[Link]()

[Link]()

Output:
Unit-II. ORANGE DATA MINING TASKS
1. Data Visualization: Import dataset; use Data Table, Box Plot, and Distributions.
2. Classification Task: Use File -> Data Table -> Logistic Regression -> Confusion Matrix.
3. Evaluation of Classification Model: Use Test & Score and ROC Analysis.
4. Image Analytics: Use Image Viewer, Image Embedder.
5. Word Cloud: Use Text and Word Cloud widgets with a sample text file.

Unit-III. DATA STORYTELLING PROJECT


Title: Impact of Mid-Day Meal Scheme (MDMS) on Student Dropout Rates

Objective:
To explore how the implementation of MDMS in 1995 influenced student dropout rates in a selected state.

Steps Involved:
1. Problem Definition: Hypothesis - MDMS reduced dropout rates.
2. Data Collection: UDISE+, [Link] datasets.
3. Data Cleaning: Handle missing values and normalize data.
4. Analysis: Compare dropout trends pre- and post-1995.
5. Visualization: Use bar/line graphs, pie charts.
6. Insights & Storytelling: Add narrative insights and consider external influences.

Conclusion:
Summarize findings showing the impact of MDMS with policy recommendations.

You might also like