• 大小: 7.72MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-26
  • 语言: 其他
  • 标签: LPP  

资源简介

局部保持投影算法 LPP 有数据mat 可以实现

资源截图

代码片段和文件信息

function W = constructW(Xoptions)
% Usage:
% W 2= constructW(Xoptions)
%
% X: Rows of vectors of data points. Each row is x_i
%   options: Struct value in Matlab. The fields in options that can be set:
%           Metric -  Choices are:
%               ‘Euclidean‘ - Will use the Euclidean distance of two data 
%                             points to evaluate the “closeness“ between 
%                             them. [Default One]
%                  
%           NeighborMode -  Indicates how to construct the graph. Choices
%                           are: 
%                ‘KNN‘            -  Put an edge between two nodes if and
%                                    only if they are among the k nearst
%                                    neighbors of each other. You are
%                                    required to provide the parameter k in
%                                    the options. [Default One]
%                                              
%           WeightMode   -  Indicates how to assign weights for each edge
%                           in the graph. Choices are:
%               ‘HeatKernel‘   - If nodes i and j are connected put weight
%                                W_ij = exp(-norm(x_i - x_j)/t). This
%                                weight mode can only be used under
%                                ‘Euclidean‘ metric and you are required to
%                                provide the parameter t.
%               
%            k         -   The parameter needed under ‘KNN‘ NeighborMode.
%                          Default will be 5.
%            t         -   The parameter needed under ‘HeatKernel‘
%                          WeightMode. Default will be 1
%
%    Examples:
%
%       X = rand(5015);
%       options = [];
%       options.Metric = ‘Euclidean‘;
%       options.NeighborMode = ‘KNN‘;
%       options.k = 5;
%       options.WeightMode = ‘HeatKernel‘;
%       options.t = 1;
%       W = constructW(Xoptions);
%       
%       
%       
%    
%
%    Written by Qiuqiu Li(qiuqium11@163.com) April/2013

%%  define parameters‘ Default-value
if (~exist(‘options‘‘var‘))
   options = [];
else
   if ~isstruct(options) 
       error(‘parameter error!‘);
   end
end

% define options.Metric=================================================
if ~isfield(options‘Metric‘)
    options.Metric = ‘Euclidean‘;
end


% define options.NeighborMode =================================================
if ~isfield(options‘NeighborMode‘)
    options.NeighborMode = ‘KNN‘;
end

 if ~isfield(options‘k‘)
     options.k = 5;
 else if options.k < 1
         options.k = 1;
     end
end

% define options.WeightMode =================================================

if ~isfield(options‘t‘)
    options.t = 1000000;
end


%%  constructW
[nSmp ~] = size(X);

     %%  constructing the difference in value between  two samples matrix[(‘Euclidean‘ and ‘Cosine‘)‘s D]

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-10-11 21:22  LPP\
     文件     2784549  2013-10-09 16:50  LPP\AR1D_data.mat
     文件        4519  2013-10-09 20:58  LPP\LPP.m
     文件        1313  2013-10-11 21:22  LPP\LPP_knn.asv
     文件        1542  2013-10-19 15:26  LPP\LPP_knn.m
     文件     3764043  2013-10-09 16:51  LPP\ORL1D_data.mat
     文件        6215  2013-06-28 22:10  LPP\PCA.m
     文件     1541529  2013-10-09 16:49  LPP\Yale1D_data.mat
     文件        3744  2013-07-06 21:57  LPP\constructW.asv
     文件        3691  2013-08-02 08:04  LPP\constructW.m
     文件         398  2013-06-28 22:10  LPP\knn.m

评论

共有 条评论