Question: Describe how a 3-nearest-neighbor algorithm would classify the new instance IMAGES = none, KNOWN SENDER = no, BWORDS = one based on the training data
Describe how a 3-nearest-neighbor algorithm would classify the new instance IMAGES = none, KNOWN SENDER = no, BWORDS = one
based on the training data in Table 3.
To calculate the distance you can use hamming distance which is calculated as the number of positions at which the corresponding features have the same values.


The dataset in Table 3 shows a small set of five historical emails. The features included are IMAGES (represents how many images the email contains, possible values are: none, one, few), KNOWN SENDER (represents if the sender email is in the address book, possible values: yes, no) and B WORDS (represents if the email contains blacklisted words, possible values: none, one, few). The target feature SPAM that shows if that instance was a spam or not (possible values: yes, no). BWORDS ID IMAGES KNOWN SENDER 1 none no 2 few yes 3 none yes 4 one no 5 few no none few few SPAM yes yes no UAWN none no one no Table 3: Dataset for Question 3. (c) Describe how a 3-nearest-neighbor algorithm would classify the new instance IMAGES = none, KNOWN SENDER = no , BWORDS = one based on the training data in Table 3. To calculate the distance you can use hamming distance which is calculated as the number of positions at which the corresponding features have the same values. (10 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
