http://www.emgu.com
Assembly: Emgu.CV.ML (in Emgu.CV.ML.dll) Version: 2.3.0.1416 (2.3.0.1416)
Creaet a KNearest classifier using the specific traing data
Namespace: Emgu.CV.MLAssembly: Emgu.CV.ML (in Emgu.CV.ML.dll) Version: 2.3.0.1416 (2.3.0.1416)
Syntax
C# |
---|
public KNearest( Matrix<float> trainData, Matrix<float> responses, Matrix<byte> sampleIdx, bool isRegression, int maxK ) |
Visual Basic |
---|
Public Sub New ( _ trainData As Matrix(Of Single), _ responses As Matrix(Of Single), _ sampleIdx As Matrix(Of Byte), _ isRegression As Boolean, _ maxK As Integer _ ) |
Visual C++ |
---|
public: KNearest( Matrix<float>^ trainData, Matrix<float>^ responses, Matrix<unsigned char>^ sampleIdx, bool isRegression, int maxK ) |
Parameters
- trainData
- Type: Emgu.CV..::..Matrix<(Of <(<'Single>)>)>
The training data. A 32-bit floating-point, single-channel matrix, one vector per row
- responses
- Type: Emgu.CV..::..Matrix<(Of <(<'Single>)>)>
A floating-point matrix of the corresponding output vectors, one vector per row.
- sampleIdx
- Type: Emgu.CV..::..Matrix<(Of <(<'Byte>)>)>
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.