0% found this document useful (0 votes)
26 views2 pages

Idsup Mid Sem Exam-2023

Uploaded by

werblacklisted
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)
26 views2 pages

Idsup Mid Sem Exam-2023

Uploaded by

werblacklisted
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/ 2

Faculty of Engineering and Technology (ITER), Siksha ‘O’ Anusandhan Deemed to be University

5. (a) Write a python program to compute the mode for the 2 MID-SEMESTER EXAMINATION, April-2023
following animal dataset. Introduction to Data Science using Python (CSE 3054)
animal=[‘cat’,’tiger’,’dog’,’cat’,’lion’,’dog’
Programme: B.Tech (CSE) Semester: 6th
,’cat’,’dog’,’cat’,’cow’,’cat’,’tiger’,’lion’]
Full Marks: 30 Time: 2 Hours

(b) 2 Subject/Course Learning Outcome *Taxonomy Ques. Marks


Given a family with two (unknown) children. If we
assume that: Level Nos.
CO-1: Understand the basics of data L2, L3, L4 1(a, b, c), 8
science using python. 2(a)
 Each child is equally likely to be a boy or girl.
CO-2: Understand mathematical and L2, L3, L4 2(b, c) 22
 The gender of the second child is independent of statistical knowledge to interpret and 3(a, b, c),
the gender of first child visualize the data. 4(a, b, c),
5(a ,b, c)
B: All children are girls CO-3: Apply the techniques of L3, L4
A: The older child is a girl extracting and pre-processing the data
L: At least one of the children is a girl for solving the complex problems
*Bloom’s taxonomy levels: Remembering (L1), Understanding (L2),
Find P(B|A), P(B|L). Application (L3), Analysis (L4), Evaluation (L5), Creation (L6)

Write the python script to compute the conditional Answer all questions. Each question carries equal mark.
probability for the above two cases.
1. (a) Construct a student network using python code from the 2
(c) Write a python function for normal distribution 2 following datasets (students and student_pairs).
probability density function (PDF) named normal_pdf
which takes three parameters- x, mu, and sigma. And students = [
{ "id": 0, "name": "Rahul" },
plot the graph of this function for different values of mu
{ "id": 1, "name": "Ashok" },
and sigma. { "id": 2, "name": "Sarita" },
{ "id": 3, "name": "Piyus" },
i. mu = 0, sigma = 1 { "id": 4, "name": "Puja" },
ii. mu = -1, sigma = 1 { "id": 5, "name": "Harish" },
{ "id": 6, "name": "Rohan" },
*End of Questions* { "id": 7, "name": "Sunil" },
{ "id": 8, "name": "Rajesh" },
{ "id": 9, "name": "Amlan" },

student_pairs = [(0, 1), (0, 2), (1, 2), (1,


3), (2, 3), (3, 4), (4, 5), (5, 6), (5, 7),
(6, 8), (7, 8), (8, 9)]

Page 4of 4 ` page 1 of 4


(b) For the dataset given in Q. 1 (a), write the python script to find 2 3. (a) Write a python program to find the dot product of two 2
the number of students friend to each student id and sorts them vectors using necessary assert condition and concept of
from most number of friends to least number of friends. Type Annotations.

(c) 2 (b) Write a python function to compute the component wise 2


What is the output of the following Python script?
mean of a list of vectors. Assert the condition that the
from collections import Counter vectors must be of same length.
count = Counter(a=1, b=2, c=3, d=120, e=1,
f=219) (c) What is the output of the following python program? 2
for letter, c in count.most_common():
print( letter, c) def make_matrix(num_rows, num_cols):
return [[1 if i==j else 0 for j in
if most_common() method is replaced by items() method range(num_cols)]
in the above code then what could be the expected for i in range(num_rows)]
output.
print(make_matrix(3,3))
2. (a) What is output of the following python code? 2
Rewrite the above function having three parameters as
def display(*args, **kwargs): num_rows, num_cols and an entry_fn. Using this
print('Unnamed args:',args) function create a 3x3 matrix which produces the same
print('Keyword args: ',kwargs) output as above using lambda function.

display(1,2,3, key1='soa',key2='iter') 4. (a) Compute the covariance and Correlation between the 2
number of hours watching movies per week and the
Can the positional arguments follow the keyword number of hours sleeping per week for a group of 4
arguments in the above code? students.

(b) Generate a list of the 100 random integers between 1 to 2


100 and plot a histogram of the same. The dataset is as follows:

(c) Given the following data, 2 hours_movie= [10,12,14,8]

cars = [‘Tata’, ‘Kia’, ‘MG’, hours_sleep= [40,48,56,32]


‘Hyundai’,‘Maruti’, ‘Honda’, ‘Skoda’,
‘Mahindra’, ‘Renault’, ‘Toyota’]
(b) Write the python functions for each statistical measure 2
production = [2.2, 2.5, 3.6, 5.5, 4.5, 1.2, associated with the problem in Q. 4(a)
3.3, 8.9, 6.5, 7.6]
(c) Analyze the significance of covariance and Correlation for 2
Plot a scatter graph yearly from 2011 to 2020 the dataset given in in Q. 4(a). How covariance differs
displaying the title of graph as “Production of Cars” from correlation?
labeling the axes as “Years” and “Production in
thousands” labeling the plotted points the names of
cars.

Page 2 of 4 page 3 of 4

You might also like