Computational cost of KNNsearch function

2 visualizaciones (últimos 30 días)
Massimiliano Romana
Massimiliano Romana el 26 de Mzo. de 2021
Respondida: Gaurav Garg el 30 de Mzo. de 2021
I want to know which is the computational cost of the knnsearch algorithm in Matlab.
[~, distX] = knnsearch(X,X,'K',N,'Distance','chebychev'); where N is length of a vector X.

Respuestas (1)

Gaurav Garg
Gaurav Garg el 30 de Mzo. de 2021
Hi,
knnsearch function can be run with many different input arguments. One such argument is 'NSMethod', which describes the search method for the function.
So, knnsearch can be either 'exhaustive' (which computes the result by comparing with each point in the train dataset), or 'kdtree' (which computes the result through a kD-tree, and can take O(log N) in the best case, where N is the number of points in train set).

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by