Question Bank – Classification Module

  1. Consider the data obtained by a real estate agency. Apply decision tree classifier and hence classify following tuple, <Very high, Old>
No.IncomeAgeOwn house
1Very highYoungYes
2HighMediumYes
3LowYoungRented
4HighMediumYes
5Very highMediumYes
6MediumYoungYes
7HighOldYes
8MediumMediumRented
9LowMediumRented
10LowOldRented
11High YoungYes

2) Using the given training dataset classify the following tuple using Naïve Bayes Algorithm:

<Homeowner: No, Marital Status: Married, Job experience:3>

Homeowner Marital Status Job experience (in years) Defaulted
YesSingle 3No
NoMarried4No
NoSingle 5No
YesMarried4No
NoDivorced2Yes
NoMarried4No
YesDivorced2No
NoMarried3Yes
NoMarried3No
YesSingle2Yes

3) A sample training set for stock market is given below. Profit is the class attribute and value is based on age, contest and type. Apply decision tree induction for this dataset to generate classification rules.

AgeContest  TypeProfit
OldYesSwrDown
OldNoSwrDown
OldNoHwrDown
MidYesSwrDown
MidYesHwrDown
MidNoHwrUp
MidNoSwrUp
NewYesSwrUp
NewNoHwrUp
NewNoSwrUp

4) Given the training data set for height classification of TE students. Classify the tuple t=<Avinash, male,1.95> using Bayesian classification

Person IDNameGender HeightClass
  1ArtiF1.6Short
  2JatinM2Tall
  3MadhuriF1.9Medium
  4ManishaF2.1Tall
  5Shilpa F1.7Short
  6DineshM1.85Medium
   7DivyaF1.6Short
  8TusharM1.7Short
  9RohanM2.2Tall

5) Suppose we have a binary classifier that predicts whether an email is spam (Positive) or not spam (Negative). We evaluated the classifier on a dataset of 100 emails, and the results are as follows: The classifier correctly predicted 15 emails as spam, and they were indeed spam emails. The classifier incorrectly classified 5 emails as spam, but they were not spam; these were false alarms. The classifier correctly identified 70 emails as not spam, and they were genuinely not spam. The classifier missed 10 spam emails, incorrectly predicting them as not spam. Draw the confusion matrix and calculate Accuracy, Precision, and Recall for the Confusion matrix

6) Using the given training dataset for credit transaction. Classify a new transaction with (income= Medium and Credit=Good) using Naïve Bayes Algorithm:

<Homeowner: No, Marital Status: Married, Job experience:3>

TransactionIncomeCreditDecision
1Very highExcellentAuthorize
2High GoodAuthorize
3MediumExcellentAuthorize
4HighGoodAuthorize
5Very highGoodAuthorize
6MediumExcellentAuthorize
7HighBadRequest Id
8MediumBadRequest Id
9HighBadReject
10LowBadCall Police

7) Apply decision tree classifier to generate the tree

InstanceA1A2A3Classification
1TrueHotHighNo
2TrueHotHighNo
3FalseHotHighYes
4FalseCoolNormalYes
5FalseCoolNormalYes
6TrueCoolHighNo
7TrueHotHighNo
8TrueHotNormalYes
9FalseCoolNormalYes

8) Apply Naïve Bayes Classifier and classify the tuple:

<Age=Youth, Income= Medium, Student= Yes, Credit Rating= Fair> for the given dataset.

RIDAgeIncomeStudentCredit RatingClass: Buys Computer
1YouthHighNoFairNo
2YouthHighNoExcellentNo
3Middle-agedHighNoFairYes
4SeniorMediumNoFairYes
5SeniorLowYesFairYes
6SeniorLowYesExcellentNo
7Middle-agedLowYesExcellentYes
8YouthMediumNoFairNo
9YouthLowYesFairYes
10SeniorMediumYesFairYes
11YouthMediumYesExcellentYes
12Middle-agedMediumNoExcellentYes
13Middle-agedHighYesFairYes
14SeniorMediumNoExcellentNo

9) Calculate accuracy for the following confusion matrix.

Fraud classesYesNoTotal
Yes150200350
No15095009650
Total300970010000

10) Calculate recall, accuracy, precision

N=200Predicted to be “Spam”Predicted to be “Not Spam”
Actual “Spam”12030
Actual “Not Spam”1040