# Nearest Neighbors

## Common

### Input Data

|                    | Inputs                                                                                                                             |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| **\*Target Data**  | Data Input                                                                                                                         |
| **\*Model Name**   | Name of the user-defined linear model                                                                                              |
| **Predict Output** | <p>If not empty, the model will additionally make prediction on <strong>Target Data</strong> and store</p><p> the result here.</p> |
| **Merge Data**     | Predict Output will be created with predicted labels concatenated to Merge Data.                                                   |
| **\*x**            | <p>User-selected columns to be x.</p><ul><li>One or more <strong>numeric</strong> columns should be selected.</li></ul>            |
| **\*y**            | <p>User-selected columns to be y.</p><ul><li>Only one column should be selected.</li></ul>                                         |

###

![\[Task information of KNeighborsClassifier\]](https://3929524962-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MGaxNdSdRN_L_WNiX4I%2F-MKZoYhIPAjg3fgcFZqP%2F-MKZpJzo5Z0k_Ttxxt9C%2Fimage.png?alt=media\&token=2452aeee-c246-44c8-b8e2-5db7090e7650)

## Workflow Example

[R-Flow Task Example Video- KNeighborsClassifier](https://www.youtube.com/watch?v=kjTseLJ4F-w)

![](https://3929524962-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MGaxNdSdRN_L_WNiX4I%2F-MLO9q4PahADFDgUsyLi%2F-MLOF1xajNxUFXjbN_Un%2Fimage.png?alt=media\&token=026a2c65-1803-4a30-a2cd-20ca2af6baaf)

## Python Package

**KNeighborsClassifier**: <https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KNeighborsClassifier.html>

**KNeighborsRegressor**: <https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KNeighborsRegressor.html>

**LocalOutlierFactor**: <https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.LocalOutlierFactor.html>

**RadiusNeighborsClassifier**: <https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.RadiusNeighborsClassifier.html>

**RadiusNeighborsRegressor**: <https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.RadiusNeighborsRegressor.html>

**NearestCentroid**: <https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NearestCentroid.html>

**Neighborhood Comp. Analysis**: <https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NeighborhoodComponentsAnalysis.html>
