In scikit-learn, what does
KNeighborsClassifier.fit(X, y) actually do?- aIt stores the training set inside a neighbour-search index and estimates no parameters✓
- bIt estimates one weight per feature by minimising squared error over the training rows
- cIt computes one centroid per class label and keeps only those centroids for prediction
- dIt builds threshold rules by recursively splitting the feature space into pure regions
Explanation:k-nearest-neighbours is a lazy learner: fitting only memorises the training rows, optionally organising them into a KD-tree or ball-tree for faster lookup. No coefficients, centroids or split rules are derived, which is why training is nearly free while every prediction pays the neighbour-search cost.