kisomap_demo.asv

来自「实现核ISOMAP算法,解决测试点问题和ROBUST问题」· ASV 代码 · 共 53 行

ASV
53
字号
% kisomap_demo.m
%
% Kernel Isomap Demo
% 
% by hychoi@postech.ac.kr, http://home.postech.ac.kr/~hychoi/
%   Heeyoul Choi
%   Dept. of Computer Science
%   POSTECH, Korea
%
% June 4, 2004

fprintf('\n------------------------------------------\n');
fprintf('             Kernel Isomap Demo             \n');
fprintf('                  by hychoi@postech.ac.kr\n');
fprintf('------------------------------------------\n\n');
clear all;
%load 'data\noisy_swiss.mat'; 
load 'data\scurvedata.mat';

TrainN = 1500; 
%TestN = 100;

%TrainX = X(:,1:TrainN); 
%TestX = X(:, TrainN+1:TrainN+TestN);
TrainX=X;
TestX=noise2;

dims = 2; % Reduced Dimension...
K=5;      % the Number of Neighborhood...

% Training...
disp('Training...');
[TrainY, U, BK0, D, BMLam] = kisomap_train(TrainX, K, dims); 

% Test...
disp('Test...');
[TestY, TestD] = kisomap_test(TestX, TrainX, U, BK0, D, K, BMLam);


% Display...
if dims == 2
    disp('Display...');
    figure;
    clf; colordef none; colormap jet; set(gcf,'Position',[200,400,800,400]);

    subplot(1,2,1); view([50 60]); grid off; hold on; axis off;
    plot3(TrainX(1,:), TrainX(2,:), TrainX(3,:), 'y.'); 
    scatter3(TestX(1,:), TestX(2,:), TestX(3,:),30,tt(TrainN+1:TrainN+TestN), '*');
    
    subplot(1,2,2); cla; hold on; axis off;
    plot(TrainY(1,:), TrainY(2,:), 'y.');
    scatter(TestY(1,:), TestY(2,:),30, tt(TrainN+1:TrainN+TestN), '*');
end

⌨️ 快捷键说明

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