Computational cost of KNNsearch function

1 回表示 (過去 30 日間)
Massimiliano Romana
Massimiliano Romana 2021 年 3 月 26 日
回答済み: Gaurav Garg 2021 年 3 月 30 日
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.

回答 (1 件)

Gaurav Garg
Gaurav Garg 2021 年 3 月 30 日
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).

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by