You are here: Start » AVL.NET » AVL.KNN_Train
Trains KNN classifier using sample data.
| Namespace: | AvlNet |
|---|---|
| Assembly: | AVL.NET.dll |
Syntax
C++
C#
public static void KNN_Train ( AvlNet.KNNModel inKNNModel, IList<IList<float>> inFeatures, IList<int> inClasses, AvlNet.KNNModel outKNNModel )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() | inKNNModel | AvlNet.KNNModel | Initialized KNN model. | ||
![]() | inFeatures | System.Collections.Generic.IList<System.Collections.Generic.IList<float>> | Array of features array. | ||
![]() | inClasses | System.Collections.Generic.IList<int> | Array of classes corresponding to feature array elements. | ||
![]() | outKNNModel | AvlNet.KNNModel | Trained KNN model. |
Errors
List of possible exceptions:
| Error type | Description |
|---|---|
| DomainError | Array inClasses contains negative values in KNN_Train. |
| DomainError | Array inClasses contains values grater than maximal class value in KNN_Train. |
| DomainError | Input array inClasses is empty in KNN_Train. |
| DomainError | Input array inFeatures is empty in KNN_Train. |
| DomainError | Input inFeatures contains array of different sizes in KNN_Train. |
| DomainError | The inFeatures size is different than inClasses size in KNN_Train. |
| DomainError | Using uninitialized classifier in KNN_Train. |


