⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kpca_plot.m

📁 核主成分分析KPCA算法源码[matlab]
💻 M
字号:
function kpca_plot(basis,gr,ip);%KPCA_PLOT visualizes the kpca basis.%%   usage%      kpca_plot(basis);%%   input%      basis    kpca basis generated by kpca_calc (see there)%      gr       resolution (default == 17)%      ip       if ip==1 then the input vectors are plotted as well%               (default ip==1)%%   see also%      kpca_calc, kpca_map%%   STH * 12MAR2002if ~exist('gr')|isempty(gr), gr = 17; endif ~exist('ip')|isempty(ip), ip = 1; endif size(basis.xs,1)~=2  error([mfilename ': can only visualize two dim input spaces.'])end% plot resulting directionsx1min = min(basis.xs(1,:));  x1max = max(basis.xs(1,:));x2min = min(basis.xs(2,:));  x2max = max(basis.xs(2,:));[X,Y] = meshgrid(linspace(x1min,x1max,gr),linspace(x2min,x2max,gr));Z = [X(:) , Y(:)]';phiZ = kpca_map(Z,basis);clfd = size(basis.V,2);for i = 1:d  supplot(d,i)  pcolor(X,Y,reshape(phiZ(i,:),[gr gr]))  hold on  contour(X,Y,reshape(phiZ(i,:),[gr gr]),10)  shading flat  if ip==1    plot(basis.xs(1,:),basis.xs(2,:),'.','markersize',1)  end  title(['\lambda_{' num2str(i) '}=' num2str(basis.Lambda(i,i))])  axis equal, axis tight, axis offend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -