Table of Contents

Class KNearest

Namespace
OpenCvSharp.ML
Assembly
OpenCvSharp.dll

K nearest neighbors classifier

public class KNearest : StatModel, IDisposable
Inheritance
KNearest
Implements
Inherited Members

Properties

AlgorithmType

Algorithm type, one of KNearest::Types.

DefaultK

Default number of neighbors to use in predict method.

Emax

Parameter for KDTree implementation

IsClassifier

Whether classification or regression model should be trained.

Methods

Create()

Creates the empty model

FindNearest(InputArray, int, OutputArray, OutputArray, OutputArray)

Finds the neighbors and predicts responses for input vectors.

Load(string)

Loads and creates a serialized model from a file.

LoadFromString(string)

Loads algorithm from a String.