Overview
Optimized feature selection on K-Nearest Neighbors (KNN) for breast cancer classification using Particle Swarm Optimization (PSO) and Genetic Algorithms (GA) implemented entirely from scratch in pure Python and NumPy.
Metrics
| Method | Features Used | Test Accuracy |
|---|---|---|
| KNN Baseline | 30/30 | 94.74% |
| KNN + GA (from scratch) | 17/30 | 95.61% |
| KNN + PSO (from scratch) | 14/30 | 95.61% |
- PSO achieved the same accuracy with fewer features (14 vs 17), proving higher optimization efficiency.
Tech Stack: Python, NumPy, Scikit-learn
Last updated on September 16, 2026 at 12:23 PM UTC+7. See Changelog