You are here: Start » AVL.NET » Function Reference » Data Classification » Nearest Neighbors » AVL.KNN_Classify

AVL.KNN_Classify

Classify data using the KNN classifier.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void KNN_Classify
(
	AvlNet.KNNModel inKNNModel,
	IList<float> inFeature,
	int inK,
	AvlNet.Metric inDistanceType,
	out int outClass
)

Parameters

Name Type Range Default Description
inKNNModelAvlNet.KNNModelTrained KNN model.
inFeatureSystem.Collections.Generic.IList<float>Vector of features.
inKint<1, +INF>Numbers of neighbors.
inDistanceTypeAvlNet.MetricGeometry distance type used to calculate neighbors.
outClassint

Errors

List of possible exceptions:

Error type Description
DomainError The inFeature has different dimensions count than KNNModel in KNN_Classify.
DomainError The inK is bigger than data samples count in KNN_Classify.
DomainError Using not trained classifier in KNN_Classify.

See also