Summer 2026 Help

CQ.AI k-Nearest Neighbors Algorithm (KNN)

Overview

k‑Nearest Neighbors (KNN) predicts a result by comparing a new data point to nearby data points. You measure distance, rank the closest points, and use the selected k neighbors to determine the result. KNN works well when data does not follow a fixed decision pattern.

  • Classification: Assigns the most common class among the neighbors.

  • Regression: Returns the average value of the neighbors.

How KNN Works for Similarity Search in CQ.AI

KNN.jfif
:info:

Note:

  • Blue and red points represent data from two different classes.

  • The black X represents a new data point under evaluation.

  • Green circles mark the three nearest neighbors to the new point.

For details on KNN similarity search, see the CQ AI Settings page.


💡

We Value Your Feedback

To provide feedback or suggestions to improve the help content on this page click here.