> ## Documentation Index
> Fetch the complete documentation index at: https://shapely.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# KNN Classifier

>  K-Nearest Neighbors (KNN) classifies a data point based on the majority class of its nearest neighbors. It finds the K closest training samples and assigns the most common class among them.

This simple yet effective algorithm requires no training phase. It memorizes the data and makes decisions at prediction time. 

<Note>
  * KNN is sensitive to the scale of features. Always use the **Feature Scaler** node to normalize your data before applying KNN. Use the **K-Finder** analysis node to determine the optimal K value.
  * Ideal for initial exploration of classification problems before trying more complex models.
</Note>

### Use Cases

* **Room similarity detection**: Find rooms most similar in shape and area to a reference room.
* **Zone classification**: Assign zones (residential, commercial, industrial) based on spatial properties.

<a href="/images/ML/KNN Classifier.png" target="_blank">
  <img src="https://mintcdn.com/shapely/GiFxyBIPYCb4gWwv/images/ML/KNN%20Classifier.png?fit=max&auto=format&n=GiFxyBIPYCb4gWwv&q=85&s=a5ee3505b4e6738bfde1fb57a5bbc6a6" className="pointer-events-none" style={{ borderRadius: '0.5rem', border: '1px solid rgba(0,0,0,0.1)' }} width="1408" height="1078" data-path="images/ML/KNN Classifier.png" />
</a>
