Emgu CV Library Documentation
KNearest Constructor (trainData, responses, sampleIdx, isRegression, maxK)
NamespacesEmgu.CV.MLKNearestKNearest(Matrix<(Of <(Single>)>), Matrix<(Of <(Single>)>), Matrix<(Of <(Int32>)>), Boolean, Int32)

Creaet a KNearest classifier using the specific traing data
Declaration Syntax
C#Visual BasicVisual C++
public KNearest(
	Matrix<float> trainData,
	Matrix<float> responses,
	Matrix<int> sampleIdx,
	bool isRegression,
	int maxK
Public Sub New ( _
	trainData As Matrix(Of Single), _
	responses As Matrix(Of Single), _
	sampleIdx As Matrix(Of Integer), _
	isRegression As Boolean, _
	maxK As Integer _
	Matrix<float>^ trainData, 
	Matrix<float>^ responses, 
	Matrix<int>^ sampleIdx, 
	bool isRegression, 
	int maxK
trainData (Matrix<(Of <(Single>)>))
The training data. A 32-bit floating-point, single-channel matrix, one vector per row
responses (Matrix<(Of <(Single>)>))
A floating-point matrix of the corresponding output vectors, one vector per row.
sampleIdx (Matrix<(Of <(Int32>)>))
Can be IntPtr.Zero if not needed. When specified, identifies samples of interest. It is a Matrix>int< of nx1
isRegression (Boolean)
Specify the output variables type. It can be either categorical (isRegression=false) or ordered (isRegression=true)
maxK (Int32)
The number of maximum neighbors that may be passed to the method findNearest.

Assembly: Emgu.CV.ML (Module: Emgu.CV.ML) Version: (