📄 kisomap_demo.m
字号:
% 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';
TrainN = 1100;
TestN = 100;
TrainX = X(:,1:TrainN);
TestX = X(:, TrainN+1:TrainN+TestN);
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -