In this project, I have built a k-NN Classifier to classify the party affiliation of United States Congressmen based on their voting records.
After training the model, I have calculated model performances.
Also, optimized the classification model with Hyperparamter tuning.
You can also refer to my Blog on Medium. Here is the link ==> Implementation of a k-Nearest Neighbors Model with Python
I have used Congressional Voting Records Dataset from UCI Machine Learning Repository.
This data set includes votes for each of the U.S. House of Representatives Congressmen on the 16 key votes identified by the CQA. The CQA lists nine different types of votes: voted for, paired for, and announced for (these three simplified to yea), voted against, paired against, and announced against (these three simplified to nay), voted present, voted present to avoid conflict of interest, and did not vote or otherwise make a position own (these three simplified to an unknown disposition).
- Importing the necessary libraries
- Importing and Loading the dataset
- Knowing the dataset
- Exploratory Data Analysis (EDA)
- Data Preprocessing
- Data Modeling
- Diagnosing Classification Predictions
- Confusion Matrix
- Classification Report
- ROC Curve
- Area Under Curve (AUC)
- Cross Validation
- Hyperparameter Tuning
- Grid Search Cross Validation
- Conclusion