Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.clickml.app/llms.txt

Use this file to discover all available pages before exploring further.

K-Nearest Neighbors (KNN) makes predictions by finding the K training examples closest to the input and returning their most common class. No training phase is required — the model stores the training data and queries it at prediction time.

Configuration

ParameterDescriptionDefault
N NeighborsNumber of neighbors to consider.5
Weightsuniform — all neighbors vote equally. distance — closer neighbors vote more.uniform
MetricDistance metric: minkowski, euclidean, manhattan, chebyshevminkowski
PPower parameter for minkowski. p=1 is Manhattan, p=2 is Euclidean.2

Input / Output

Type
InputX Train + Y Train
OutputTrained Model

When to use

Simple and effective for small datasets. Always scale features — KNN is purely distance-based and will give misleading results if features are on different scales. Slow at prediction time on large datasets.