Click or drag to resize

KNearestFindNearest Method

http://www.emgu.com
Finds the neighbors and predicts responses for input vectors.

Namespace:  Emgu.CV.ML
Assembly:  Emgu.CV.World (in Emgu.CV.World.dll) Version: 4.0.1.3373 (4.0.1.3373)
Syntax
public float FindNearest(
	IInputArray samples,
	int k,
	IOutputArray results,
	IOutputArray neighborResponses = null,
	IOutputArray dist = null
)

Parameters

samples
Type: Emgu.CVIInputArray
Input samples stored by rows. It is a single-precision floating-point matrix of <number_of_samples> * k size.
k
Type: SystemInt32
Number of used nearest neighbors. Should be greater than 1.
results
Type: Emgu.CVIOutputArray
Vector with results of prediction (regression or classification) for each input sample. It is a single-precision floating-point vector with <number_of_samples> elements.
neighborResponses (Optional)
Type: Emgu.CVIOutputArray
Optional output values for corresponding neighbors. It is a single- precision floating-point matrix of <number_of_samples> * k size.
dist (Optional)
Type: Emgu.CVIOutputArray
Optional output distances from the input vectors to the corresponding neighbors. It is a single-precision floating-point matrix of <number_of_samples> * k size.

Return Value

Type: Single
If only a single input vector is passed, the predicted value is returned by the method.
See Also