資源簡介
流形學(xué)習(xí)算法之一,具有較強的數(shù)據(jù)挖掘能力,能夠用于模式識別。
代碼片段和文件信息
function?mappedX=?LE(X?no_dims?k?sigma)
%LAPLACIAN_EIGEN?Performs?non-linear?dimensionality?reduction?using?Laplacian?Eigenmaps
%
%???[mappedX?mapping]?=?laplacian_eigen(X?no_dims?k?sigma?eig_impl)
%
%?Performs?non-linear?dimensionality?reduction?using?Laplacian?Eigenmaps.
%?The?data?is?in?matrix?X?in?which?the?rows?are?the?observations?and?the
%?columns?the?dimensions.?
%?The?reduced?data?is?returned?in?the?matrix?mappedX.
????if?~exist(‘no_dims‘?‘var‘)
????????no_dims?=?2;
????end
????if?~exist(‘k‘?‘var‘)
????????k?=?12;
????end
if?~exist(‘sigma‘?‘var‘)
sigma?=?1;
????end
??
????%?Construct?neighborhood?graph
????disp(‘Constructing?neighborhood?graph...‘);
????if?size(X?1)?4000
????????G?=?squareform(pdist(X?‘euclidean‘));
????????%?Compute?neighbourhood?graph
????????[tmp?ind]?=?sort(G);?
????????for?i=1:size(G?1)
????????????G(i?ind((2?+?k):end?i))?=?0;?
????????end
????????G?=?sparse(double(G));
????????G?=?max(G?G‘);?????????????%?Make?sure?distance?matrix?i
評論
共有 條評論