> ## 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 Regressor component

> Predict continuous values by averaging the targets of the K nearest neighbors, with configurable distance metrics and neighbor weighting strategies.

**K-Nearest Neighbors Regressor** finds the K training examples closest to the input and returns their average target value.

## Configuration

| Parameter       | Description                                                            | Default     |
| --------------- | ---------------------------------------------------------------------- | ----------- |
| **N Neighbors** | Number of neighbors to consider.                                       | `5`         |
| **Weights**     | `uniform` — simple average. `distance` — weighted by inverse distance. | `uniform`   |
| **Metric**      | Distance metric: `minkowski`, `euclidean`, `manhattan`, `chebyshev`    | `minkowski` |
| **P**           | Power for `minkowski`. `p=1` = Manhattan, `p=2` = Euclidean.           | `2`         |

## Input / Output

|        | Type                  |
| ------ | --------------------- |
| Input  | `X Train` + `Y Train` |
| Output | Trained Model         |

## When to use

Simple baseline that works well on small datasets. **Always scale features** before KNN.
