The Alchemist.
HomeAI EngineeringSubstack
SubscribeLogin
Machine Learning
Feature Engineering
Imbalanced Datasets
Linear Regression
Logistic Regression
Svm
Naive Bayes
Knn
Decision Tree
Ensemble
Unsupervised
  1. Home
  2. Blog
  3. Machine Learning
  4. Knn
Back to Machine Learning

~/blog/tutorials/machine-learning

Knn

Tutorial
Jun 26, 20268 min read
0

KNN: Classification and Regression Intuition

Most classifiers learn parameters during training — weights, thresholds, tree splits — and use those parameters to make predictions. KNN does neither. There is…

Tutorial
Jun 26, 20269 min read
0

KD-Tree and Ball Tree: KNN Optimization

Brute-force KNN computes the distance from every query to every training sample — $O(n)$ distance computations per prediction. At one million training samples a…

Tutorial
Jun 26, 20267 min read
0

KNN Classifier and Regressor: Full Implementation

KNN theory and spatial data structures are complete. This post runs KNN classifier on Wine Quality and KNN regressor on California Housing — finding optimal $k$…

© 2026 Mohammed Vasim. Built with curiosity.