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.1.0.3408 (4.1.0.3408)
Syntaxpublic float FindNearest(
IInputArray samples,
int k,
IOutputArray results,
IOutputArray neighborResponses = null,
IOutputArray dist = null
)
Public Function FindNearest (
samples As IInputArray,
k As Integer,
results As IOutputArray,
Optional neighborResponses As IOutputArray = Nothing,
Optional dist As IOutputArray = Nothing
) As Single
public:
float FindNearest(
IInputArray^ samples,
int k,
IOutputArray^ results,
IOutputArray^ neighborResponses = nullptr,
IOutputArray^ dist = nullptr
)
member FindNearest :
samples : IInputArray *
k : int *
results : IOutputArray *
?neighborResponses : IOutputArray *
?dist : IOutputArray
(* Defaults:
let _neighborResponses = defaultArg neighborResponses null
let _dist = defaultArg dist null
*)
-> float32
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:
SingleIf only a single input vector is passed, the predicted value is returned by the method.
See Also