- Consider the data obtained by a real estate agency. Apply decision tree classifier and hence classify following tuple, <Very high, Old>
| No. | Income | Age | Own house |
| 1 | Very high | Young | Yes |
| 2 | High | Medium | Yes |
| 3 | Low | Young | Rented |
| 4 | High | Medium | Yes |
| 5 | Very high | Medium | Yes |
| 6 | Medium | Young | Yes |
| 7 | High | Old | Yes |
| 8 | Medium | Medium | Rented |
| 9 | Low | Medium | Rented |
| 10 | Low | Old | Rented |
| 11 | High | Young | Yes |
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 |
| Yes | Single | 3 | No |
| No | Married | 4 | No |
| No | Single | 5 | No |
| Yes | Married | 4 | No |
| No | Divorced | 2 | Yes |
| No | Married | 4 | No |
| Yes | Divorced | 2 | No |
| No | Married | 3 | Yes |
| No | Married | 3 | No |
| Yes | Single | 2 | Yes |
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.
| Age | Contest | Type | Profit |
| Old | Yes | Swr | Down |
| Old | No | Swr | Down |
| Old | No | Hwr | Down |
| Mid | Yes | Swr | Down |
| Mid | Yes | Hwr | Down |
| Mid | No | Hwr | Up |
| Mid | No | Swr | Up |
| New | Yes | Swr | Up |
| New | No | Hwr | Up |
| New | No | Swr | Up |
4) Given the training data set for height classification of TE students. Classify the tuple t=<Avinash, male,1.95> using Bayesian classification
| Person ID | Name | Gender | Height | Class |
| 1 | Arti | F | 1.6 | Short |
| 2 | Jatin | M | 2 | Tall |
| 3 | Madhuri | F | 1.9 | Medium |
| 4 | Manisha | F | 2.1 | Tall |
| 5 | Shilpa | F | 1.7 | Short |
| 6 | Dinesh | M | 1.85 | Medium |
| 7 | Divya | F | 1.6 | Short |
| 8 | Tushar | M | 1.7 | Short |
| 9 | Rohan | M | 2.2 | Tall |
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>
| Transaction | Income | Credit | Decision |
| 1 | Very high | Excellent | Authorize |
| 2 | High | Good | Authorize |
| 3 | Medium | Excellent | Authorize |
| 4 | High | Good | Authorize |
| 5 | Very high | Good | Authorize |
| 6 | Medium | Excellent | Authorize |
| 7 | High | Bad | Request Id |
| 8 | Medium | Bad | Request Id |
| 9 | High | Bad | Reject |
| 10 | Low | Bad | Call Police |
7) Apply decision tree classifier to generate the tree
| Instance | A1 | A2 | A3 | Classification |
| 1 | True | Hot | High | No |
| 2 | True | Hot | High | No |
| 3 | False | Hot | High | Yes |
| 4 | False | Cool | Normal | Yes |
| 5 | False | Cool | Normal | Yes |
| 6 | True | Cool | High | No |
| 7 | True | Hot | High | No |
| 8 | True | Hot | Normal | Yes |
| 9 | False | Cool | Normal | Yes |
8) Apply Naïve Bayes Classifier and classify the tuple:
<Age=Youth, Income= Medium, Student= Yes, Credit Rating= Fair> for the given dataset.
| RID | Age | Income | Student | Credit Rating | Class: Buys Computer |
| 1 | Youth | High | No | Fair | No |
| 2 | Youth | High | No | Excellent | No |
| 3 | Middle-aged | High | No | Fair | Yes |
| 4 | Senior | Medium | No | Fair | Yes |
| 5 | Senior | Low | Yes | Fair | Yes |
| 6 | Senior | Low | Yes | Excellent | No |
| 7 | Middle-aged | Low | Yes | Excellent | Yes |
| 8 | Youth | Medium | No | Fair | No |
| 9 | Youth | Low | Yes | Fair | Yes |
| 10 | Senior | Medium | Yes | Fair | Yes |
| 11 | Youth | Medium | Yes | Excellent | Yes |
| 12 | Middle-aged | Medium | No | Excellent | Yes |
| 13 | Middle-aged | High | Yes | Fair | Yes |
| 14 | Senior | Medium | No | Excellent | No |
9) Calculate accuracy for the following confusion matrix.
| Fraud classes | Yes | No | Total |
| Yes | 150 | 200 | 350 |
| No | 150 | 9500 | 9650 |
| Total | 300 | 9700 | 10000 |
10) Calculate recall, accuracy, precision
| N=200 | Predicted to be “Spam” | Predicted to be “Not Spam” |
| Actual “Spam” | 120 | 30 |
| Actual “Not Spam” | 10 | 40 |