Sklearn KNN icon

Sklearn KNN

K-Nearest Neighbors classifier and regressor using scikit-learn

Actions2

Train

AI-generated

Summary

Train a K-Nearest Neighbors classifier or regressor using scikit-learn on the incoming data.

Inputs

  • main (required) — Array of items, each must contain the columns specified in Feature Columns and Target Column.

Output shape

single item array

Returns one item containing the trained model (base64‑encoded pickle) and training metadata.

Examples

Example 1: Train a classifier on iris data

Model Type: Classifier, Feature Columns: sepal_length,sepal_width,petal_length,petal_width, Target Column: species, K: 5

Discussion