Apply KNN algorithm to classify whether cancer is present or not. Implemented Pipeline, GridSearchCV, Elbow method to fit the best model.
- Import the modules and dependencies.
- Load the dataset.
- Analyse the dataset, get shape and info and check for null values and balance of the dataset.
- Slice the data into features and label.
- Split the data into training dataset and testing dataset.
- Apply feature scaling features of training and testing datasets.
- Apply KNN algorithm with k=1.
- Evaluate the model.
- Improve the model with Full Cross Validation.
- Use Elbow method to find reasonable k values.
- Implement full cross validation using GridSearchCV.
- Create a Pipeline and parameters grid of k values to fit GridSearchCV.
- Evaluate the final model.
Implemented KNN classification and improved the model with Full Cross Validation using Elbow method,Pipeline and GridSearchCV.