K-Nearest Neighbors
摘要
Supervised learning is a core idea in AI. A model learns to predict labels from labeled data [11]. In image classification, a model trains on many labeled images, such as cats, dogs, or cars. It learns to link visual patterns to these classes. In healthcare, supervised models estimate disease risk from structured inputs such as blood pressure, cholesterol, and age. Training uses a dataset of \( n \) labeled examples. Each input pattern \( \textbf{x}_j \in \mathbb {R}^d \) is a \( d \) -dimensional vector. The label \( y_j \in \mathcal {Y} \) matches the input: \(\mathcal {X} = \{ (\textbf{x}_1, y_1), (\textbf{x}_2, y_2), \dots , (\textbf{x}_n, y_n) \}.\) Each pattern \( \textbf{x}_j = (x_{j1}, x_{j2}, \dots , x_{jd}) \) contains \( d \) features. The value \( x_{ji} \) is the \( i \) -th feature of the \( j \) -th pattern. The aim is to learn a function \( f(\textbf{x}) \) that maps inputs to outputs. During training, the model updates parameters to reduce the gap between predictions \( f(\textbf{x}_j) \) and true labels \( y_j \) . These labeled examples form the ground truth.