Supervised Learning - Classification Week 8 Challenge
Q1.
The accuracy for different algorithms were as follows
| Algorithm | Training accuracy | Testing accuracy |
| Logistic regression | 0.79 | 0.8 |
| Decision tree | 1 | 0.8 |
| Random forest | 1 | 0.83 |
| Support vector machine | 0.84 | 0.83 |
| K nearest neighbours | 0.85 | 0.83 |
Prescriptive analysis :
The accuracy can was highest when the k value is 5, There is a small underfitting issue in the knn algorithm which can resolved by taking more data samples. The accuracy can be also improved by performing a k-fold cross validation which gives us the average accuracy for all different train and test split.
Other algorithms like Decision tree, Random forest were faced with overfitting issues. SVM and Knn produce the best results for this dataset.
Q2.
Pros :
- No training period required hence also called as lazy learning algorithm
- Easy to implement
- Many new data can be added without any changes to the model
- It is a simple Machine Learning algorithm and easy to understand.
- kNN can be used for classification and regression.
- It can be used for multi-class problem.
- It provides a variety of distance criteria to choose from: Euclidean Distance Hamming Distance Manhattan Distance Minkowski Distance
Cons :
- Does not work well with high dimensional data
- Feature scaling is required
- Sensitive to noisy data and outliers
- It is difficult to choose the optimal number of neighbors to be consider while classifying the new data entry.
- K-NN inherently has no capability of dealing with missing value problem.
- k Nearest Neighbor has calculate the proximity between each neighbors for every single value in the dataset. For large daasets its computation cost increases.