Supervised Learning - Classification Week 8 Challenge
Ans 2. Pros and cons of knn (K- nearest neighbours)
K-Nearest Neighbours(K-NN) is a supervised machine learning algorithm and it can be used for classification as well as regression. It is non-parametric in nature as it doesn't make any assumption of the underlying data distribution pattern. It is also named a lazy algorithm as it doesn't have any training steps. It predicts the cluster to which the new data point will based on feature similarity. In K-NN, "K" is a number and its a hyperparameter that can have a significant impact on the result.
Pros:
- Simple to understand and easy to implement.
- It is a non-parametric algorithm and hence, there are no assumptions.
- It can be used for classification as well as regression.
- There is flexibility for the user to select distance while building the model such as Euclidean Distance, Hamming distance, Manhattan distance, and Minkowski Distance.
Cons:
- Computationally expensive as it searches for the nearest neighbours for the new data point during the prediction stage.
- Memory intensive as it stores all the data points.
- Highly sensitive to outliers and its accuracy is impacted by noise or irrelevant data.
Ans 1:













