Implementation of KNN algorithm in Python 3
- K-Nearest-Neighbors algorithm is used for classification and regression problems.
- In this project, it is used for classification.
- puchased Iphone dataset used for project.
- CSV (Comma Separated Values) format.
- Attributes can be integer or real values.
- Responses can be integer, real or categorical.
The primary goal is predict wheather customer will purchase Iphone or not from their store based on gender, age and salary.
- pandas, numpy, matplotlib,seaborn,sklearn,joblib used in project
-
- followed indistry standard practice of machine learning life cycle steps.
-
- implement necessary transformation, preprocessing of dataset.
- conduct exploratory data analysis on dataset.
-
- visualised data using visualisation library like matplotlib, seaborn.
-
- scikit library use for KNN algorithm.
-
- model validate with accuracy score of diff K, confusion metrix.
-
- joblib library used to dump model.
- model is saved in .ipynb formate as i_phone_purchase_product_using_KNN_model.
- Total female are 51% and male are 49%.
- Female average salary is more than male average salary.
- Total iphone purchased - 143 no's ( female purchased - 77 no's and male purchased - 66 no's)
- Maximum iphone purchased between age group of 46 to 50 years.( female - 47 to 48 yrs, male - 46 to 50 yrs)
- No correlation between salary with age and salary with number of iphone purchased.
- model validated with k values 19, 21 and 15 which was calculated by standard method and error method.
- accurancy score of k=15 is 0.875, so it is greater than other model.So it is considered and saved.