How it works…
Neighbors-based regression can be used in cases where the data labels are continuous, rather than discrete, variables. The label assigned to a query point is computed based on the mean of the labels of its nearest neighbors.
Scikit-learn implements two different neighbors regressors: KNeighborsRegressor implements learning based on the K nearest neighbors of each query point, where K is an integer value specified by the user. RadiusNeighborsRegressor implements learning based on the neighbors within a fixed radius r of the query point, where r is a floating-point value specified by the user.
The basic nearest neighbors regression uses uniform weights. That is, each point in the local neighborhood contributes uniformly to the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access