C# Класс OpenCvSharp.ML.KNearest

K nearest neighbors classifier
Наследование: StatModel
Показать файл Открыть проект

Открытые методы

Метод Описание
Create ( ) : KNearest

Creates the empty model

FindNearest ( InputArray samples, int k, OutputArray results, OutputArray neighborResponses = null, OutputArray dist = null ) : float

Finds the neighbors and predicts responses for input vectors.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Clean up any resources being used.

KNearest ( IntPtr p ) : System

Creates instance by raw pointer cv::ml::KNearest*

Описание методов

Create() публичный статический Метод

Creates the empty model
public static Create ( ) : KNearest
Результат KNearest

Dispose() защищенный Метод

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. ///
Результат void

FindNearest() публичный Метод

Finds the neighbors and predicts responses for input vectors.
public FindNearest ( InputArray samples, int k, OutputArray results, OutputArray neighborResponses = null, OutputArray dist = null ) : float
samples InputArray Input samples stored by rows. /// It is a single-precision floating-point matrix of `[number_of_samples] * k` size.
k int Number of used nearest neighbors. Should be greater than 1.
results OutputArray 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 OutputArray neighborResponses Optional output values for corresponding neighbors. /// It is a single-precision floating-point matrix of `[number_of_samples] * k` size.
dist OutputArray 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.
Результат float

KNearest() защищенный Метод

Creates instance by raw pointer cv::ml::KNearest*
protected KNearest ( IntPtr p ) : System
p System.IntPtr
Результат System