Skip to content

Train Classifier (K-Nearest Neighbours) Node

AI/ML/Classification

Fit a K-Nearest-Neighbours classifier. Non-parametric and instance based: the fitted model embeds a verbatim copy of the whole training set instead of learned coefficients, so every training row (and any personal data in it) travels with the model, is written into every saved model file and can be reconstructed by anyone holding it. Treat the model with the same care as the source table.

fit_knn_classifierml
Inputs4
Outputs2
Security exposure3/10
Packageml

Ratings

Scores range from 0 to 10. Higher values mean more impact, exposure, or operational weight.

SecurityAttack surface and exposure impact.
3/10Low
PrivacyPotential sensitivity of processed data.
2/10Low
PerformanceRuntime or resource pressure.
4/10Medium
GovernancePolicy, audit, or compliance impact.
2/10Low
ReliabilityOperational stability considerations.
7/10High
CostExternal or compute cost impact.
4/10Medium

Input Pins

4

Input

Execution
exec_in

Execution trigger that begins KNN training

Data Source

String
source

Choose which backend supplies the training data

Default Database
Database

Neighbours (k)

Integer
k

How many nearest training rows vote on each prediction. Must be at least 1 and cannot exceed the number of training rows. Larger values smooth the decision boundary.

Default 5
Range 1 to 1000

Distance Weighted

Boolean
distance_weighted

Weight each neighbour by the inverse of its distance instead of counting every neighbour equally. Helps when k is large or classes overlap.

Default false

Output Pins

2

Done

Execution
exec_out

Activated once the training set has been validated and embedded

Model

Struct
model

Thread-safe handle to the trained KNN classifier. Contains a full copy of the training set.

NodeMLModelNodeMLModel1 fields
model_refstringrequired
Schema enforced

Node Info

Internal name
fit_knn_classifier
Category
AI/ML/Classification