Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment: Implementing k-Nearest Neighbors (KNN) Algorithm with Normalization 1. Understanding KNN: Research and understand the basic principles of the k-Nearest Neighbors (KNN) algorithm. Recognize that
Assignment: Implementing k-Nearest Neighbors (KNN) Algorithm with Normalization 1. Understanding KNN: Research and understand the basic principles of the k-Nearest Neighbors (KNN) algorithm. Recognize that KNN is a lazy learning algorithm, and the distance cannot be calculated until new instances are provided. 2. Dataset: Utilize a simplified Iris dataset for this assignment. The dataset includes 12 records with 2 features (Feature 1 and Feature 2) and 3 classes (Setosa, Versicolor, Virginica). Each record is as follows: 3. Normalization: - Manually normalize the features of the dataset. You can use Min-Max scaling or Z-score normalization techniques. 4. Visualization - After normalizing the dataset, visualize it using a scatter plot. Plot the points for each class with different colours or shape to observe the distribution of the data. 5. Manual Implementation (New Instances): There are new instances with features related to hypothetical Iris flowers: - Please reclassify them based using the KNN algorithm - Experiment with different values of k (e.g., k=2,k=4 ) which k value seems to be better and why? Please note the following you can use any distance function. the new instances need to be normalized in the same way you normalize the training data. 5- After training the K-Nearest Neighbors (KNN) algorithm, the model was tested on 1000 instances, resulting in the following confusion matrix: Calculate the following performance metrics: Recall (Sensitivity or True Positive Rate): Precision (Positive Predictive Value): Accuracy: F1 Score: Please perform the necessary calculations using the given values in the confusion matrix and provide the results in your analysis
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started