日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人工智能 > 循环神经网络 >内容正文

循环神经网络

matlab knn,MATLAB K近邻算法 — knnsearch() 函数 | 学步园

發布時間:2024/7/23 循环神经网络 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 matlab knn,MATLAB K近邻算法 — knnsearch() 函数 | 学步园 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

K近鄰

IDX = knnsearch(X,Y) finds the nearest neighbor in X for each point in

Y. X is an MX-by-N matrix and Y is an MY-by-N matrix. Rows of X and Y

correspond to observations and columns correspond to variables. IDX is

a column vector with MY rows. Each row in IDX contains the index of

the nearest neighbor in X for the corresponding row in Y.

IDX = knnsearch(X, Y) 在向量集合X中找到分別與向量集合Y中每個行向量最近的鄰居。X大小為MX-by-N矩陣,Y為大小MY-by-N的矩陣,X和Y的行對應觀測的樣本

列對應每個樣本的變量。IDX是一個MY維的列向量,IDX的每一行對應著Y每一個觀測在X中最近鄰的索引值。

[IDX, D] = knnsearch(X,Y) returns a MY-by-1 vector D containing the

distances between each row of Y and its closest point in X.

[IDX, D]= knnsearch(X,Y,'NAME1',VALUE1,...,'NAMEN',VALUEN) specifies

optional argument name/value pairs:

Name ? ? ? ? ?Value

'K' ? ? ? ? ? A positive integer, K, specifying the number of nearest

neighbors in X to find for each point in Y. Default is

1. IDX and D are MY-by-K matrices. D sorts the

distances in each row in ascending order. Each row in

IDX contains the indices of K closest neighbors in X

corresponding to the K smallest distances in D.

“K”表示最近鄰個數,返回值D是按行升序排列。

'NSMethod' ? ?Nearest neighbors search method. Value is either:

搜尋的方法參數

'Distance' ? ? A string or a function handle specifying the distance

選擇何種距離作為最近鄰的度量標準

Example:

% Find 2 nearest neighbors in X and the corresponding values to each

% point in Y using the distance metric 'cityblock'

X = randn(100,5);

Y = randn(25, 5);

[idx, dist] = knnsearch(X,Y,'dist','cityblock','k',2);

總結

以上是生活随笔為你收集整理的matlab knn,MATLAB K近邻算法 — knnsearch() 函数 | 学步园的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。