资源简介
LPP( Locality Preserving Projections),局部保持投影,
代码片段和文件信息
function [eigvector eigvalue elapse] = LPP(W options data)
% LPP: Locality Preserving Projections
%
% [eigvector eigvalue] = LPP(W options data)
%
% Input:
% data - Data matrix. Each row vector of fea is a data point.
% W - Affinity matrix. You can either call “constructW“
% to construct the W or construct it by yourself.
% options - Struct value in Matlab. The fields in options
% that can be set:
%
% Please see LGE.m for other options.
%
% Output:
% eigvector - Each column is an embedding function for a new
% data point (row vector) x y = x*eigvector
% will be the embedding result of x.
% eigvalue - The sorted eigvalue of LPP eigen-problem.
% elapse - Time spent on different steps
%
%
% Examples:
%
% fea = rand(5070);
% options = [];
% options.Metric = ‘Euclidean‘;
% options.NeighborMode = ‘KNN‘;
% options.k = 5;
% options.WeightMode = ‘HeatKernel‘;
% options.t = 5;
% W = constructW(feaoptions);
% options.PCARatio = 0.99
% [eigvector eigvalue] = LPP(W options fea);
% Y = fea*eigvector;
%
%
% fea = rand(5070);
% gnd = [ones(101);ones(151)*2;ones(101)*3;ones(151)*4];
% options = [];
% options.Metric = ‘Euclidean‘;
% options.NeighborMode = ‘Supervised‘;
% options.gnd = gnd;
% options.bLDA = 1;
% W = constructW(feaoptions);
% options.PCARatio = 1;
% [eigvector eigvalue] = LPP(W options fea);
% Y = fea*eigvector;
%
%
% Note: After applying some simple algebra the smallest eigenvalue problem:
% data^T*L*data = \lemda data^T*D*data
% is equivalent to the largest eigenvalue problem:
% data^T*W*data = \beta data^T*D*data
% where L=D-W; \lemda= 1 - \beta.
% Thus the smallest eigenvalue problem can be transformed to a largest
% eigenvalue problem. Such tricks are adopted in this code for the
% consideration of calculation precision of Matlab.
%
%
% See also constructW LGE
%
%Reference:
% Xiaofei He and Partha Niyogi “Locality Preserving Projections“
% Advances in Neural Information Processing Systems 16 (NIPS 2003)
% Vancouver Canada 2003.
%
- 上一篇:LDA,matlab实现
- 下一篇:MOEA\\Dmatlab注释,帮助大家理解
评论
共有 条评论