Create the KNearest classifier using the specific traing data.

Namespace:  Emgu.CV.ML
Assembly:  Emgu.CV.ML (in Emgu.CV.ML.dll) Version: 2.0.0.0 (2.0.0.0)

Syntax

C#
public static IntPtr CvKNearestCreate(
	IntPtr trainData,
	IntPtr responses,
	IntPtr sampleIdx,
	bool isRegression,
	int maxK
)
Visual Basic (Declaration)
Public Shared Function CvKNearestCreate ( _
	trainData As IntPtr, _
	responses As IntPtr, _
	sampleIdx As IntPtr, _
	isRegression As Boolean, _
	maxK As Integer _
) As IntPtr
Visual C++
public:
static IntPtr CvKNearestCreate(
	IntPtr trainData, 
	IntPtr responses, 
	IntPtr sampleIdx, 
	bool isRegression, 
	int maxK
)

Parameters

trainData
Type: System..::.IntPtr
The training data. A 32-bit floating-point, single-channel matrix, one vector per row
responses
Type: System..::.IntPtr
A floating-point matrix of the corresponding output vectors, one vector per row.
sampleIdx
Type: System..::.IntPtr
Can be IntPtr.Zero if not needed. When specified, identifies samples of interest. It is a Matrix>int< of nx1
isRegression
Type: System..::.Boolean
Specify the output variables type. It can be either categorical (isRegression=false) or ordered (isRegression=true)
maxK
Type: System..::.Int32
The number of maximum neighbors that may be passed to the method findNearest.

Return Value

The KNearest classifier

See Also