The k-nearest neighbors algorithm, also known as KNN or k-NN, is a non-parametric, supervised learning classifier, which uses proximity to make classifications or predictions about the grouping of an individual data point.
Requested Feature
Build a KNN classifier and in the output, f1-score, accuracy and confusion matrix must be printed, there is a function named metrics for printing the accuracy and confusion matrix.
Hyperparameter tuning can be done to improve the accuracy. As the dataset is imbalanced, do prefer f1 score as metric while training.
The k-nearest neighbors algorithm, also known as KNN or k-NN, is a non-parametric, supervised learning classifier, which uses proximity to make classifications or predictions about the grouping of an individual data point.
Requested Feature
Build a KNN classifier and in the output, f1-score, accuracy and confusion matrix must be printed, there is a function named metrics for printing the accuracy and confusion matrix. Hyperparameter tuning can be done to improve the accuracy. As the dataset is imbalanced, do prefer f1 score as metric while training.