Back to FabImage Library website
You are here: Start » Function Reference » Data Classification » Nearest Neighbors » KNN_Classify

KNN_Classify
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationPro |
Classify data using the KNN classifier.
Syntax
C++
C#
void fil::KNN_Classify ( const fil::KNNModel& inKNNModel, const ftl::Array<float>& inFeature, const int inK, const fil::Metric::Type inDistanceType, int& outClass )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inKNNModel | const KNNModel& | Trained KNN model | ||
![]() |
inFeature | const Array<float>& | Vector of features | ||
![]() |
inK | const int | 1 - +![]() |
Numbers of neighbors | |
![]() |
inDistanceType | const Metric::Type | Geometry distance type used to calculate neighbors | ||
![]() |
outClass | int& |
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. |