Mid-Sem Exam – Machine Learning Assignment
1. A wall street Journal subscriber survey asked 46 questions about subscriber
characteristic and interest. State whether each of the following question
provides categorical or quantitative data.
a. What is your age?
b. Are you male or female?
c. When did you first start reading the WSJ? High school, College, early career,
mid-career, late Career or retirement?
d. How long have you been in your present job or position?
e. What type of vehicle are you considering for your next purchase? Nine
response categories include sedan, sports, car, SUV, and minivan.
2.1 Write a Python program to add key to a dictionary.
2.2 Write a python script to merge two dictionaries?
3.1 What will be the output of below code?
set1= {3, 8, 2, 6}
print”Set1:”, set1)
set2={7, 8, 5, 1}
print” Set2:”, set2)
set3=set1.union(set2)
print (“union:”, set3)
3.3 Write a python code to print ant string 3 times?
4.The Pima India dataset has 768 observations on 9 variables. The data frame
of data set is as below. Write your observation for data
preg int64 Number of times pregnant
plas int64 Plasma glucose concentration a 2 hours in an oral glucose
tolerance test
pres int64 Diastolic blood pressure (mm Hg)
skin int64 Triceps skin fold thickness (mm)
test int64 2-Hour serum insulin (mu U/ml)
mass float64 Body mass index (weight in kg/(height in m)^2)
pedi float64 Diabetes pedigree function
age int64 Age (years)
class int64 Class variable (0 or 1) 268 of 768 are 1, the others are 0
data.describe()
preg plas pres skin test mass pedi age class
count 768 768 768 768 768 768 768 768 768
120.89 69.10 20.53 31.99 33.24
mean 3.845 79.799 0.472 0.349
5 5 6 3 1
19.35 15.95 115.24
std 3.37 31.973 7.884 0.331 11.76 0.477
6 2 4
min 0 0 0 0 0 0 0.078 21 0
25% 1 99 62 0 0 27.3 0.244 24 0
50% 3 117 72 23 30.5 32 0.372 29 0
75% 6 140.25 80 32 127.25 36.6 0.626 41 1
max 17 199 122 99 846 67.1 2.42 81 1
5. Explain various steps involved in a machine learning project?
6. Explain with examples supervised, unsupervised and re-enforcement
learning.
7. Explain with example how Machine Learning model can be used to solve
business problem from Human resource, Marketing and Finance domain?