Emgu CV Library Documentation
KNearest Class
NamespacesEmgu.CV.MLKNearest

www.emgu.com/wiki
The KNearest classifier
Declaration Syntax
C#Visual BasicVisual C++
public class KNearest : StatModel
Public Class KNearest _
	Inherits StatModel
public ref class KNearest : public StatModel
Members
All MembersConstructorsMethodsPropertiesFields



IconMemberDescription
KNearest()()()
Create a default KNearest classifier

KNearest(Matrix<(Of <(Single>)>), Matrix<(Of <(Single>)>), Matrix<(Of <(Int32>)>), Boolean, Int32)
Creaet a KNearest classifier using the specific traing data

_ptr
A pointer to the unmanaged object
(Inherited from UnmanagedObject.)
Clear()()()
Clear the statistic model
(Inherited from StatModel.)
Dispose()()()
The dispose function that implements IDisposable interface
(Inherited from DisposableObject.)
Dispose(Boolean)
Release the all the memory associate with this object
(Inherited from DisposableObject.)
DisposeObject()()()
Release the classifer and all the memory associated with it
(Overrides DisposableObject.DisposeObject()()().)
Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Finalize()()()
Destructor
(Inherited from DisposableObject.)
FindNearest(Matrix<(Of <(Single>)>), Int32, Matrix<(Of <(Single>)>), Matrix<(Of <(Single>)>), Matrix<(Of <(Single>)>), Matrix<(Of <(Single>)>))
For each input vector (which are rows of the matrix samples) the method finds k <= get_max_k() nearest neighbor. In case of regression, the predicted result will be a mean value of the particular vector's neighbor responses. In case of classification the class is determined by voting.

GetHashCode()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetType()()()
Gets the Type of the current instance.
(Inherited from Object.)
Load(String)
Load the statistic model from file
(Inherited from StatModel.)
MemberwiseClone()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Ptr
Pointer to the unmanaged object
(Inherited from UnmanagedObject.)
Save(String)
Save the statistic model to file
(Inherited from StatModel.)
ToString()()()
Returns a String that represents the current Object.
(Inherited from Object.)
Train(Matrix<(Of <(Single>)>), Matrix<(Of <(Single>)>), Matrix<(Of <(Int32>)>), Boolean, Int32, Boolean)
Update the KNearest classifier using the specific traing data.

Inheritance Hierarchy

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