资源简介
核主成成分分析的实现过程,比较简单明了,希望对大家有作用吧
代码片段和文件信息
% Kernel PCA toy example for k(xy)=exp(-||x-y||^2/rbf_var) cf. Fig. 4 in
% @article{SchSmoMue98
% author = “B.~{Sch\“olkopf} and A.~Smola and K.-R.~{M\“uller}“
% title = “Nonlinear component analysis as a kernel Eigenvalue problem“
% journal = {Neural Computation}
% volume = 10
% issue = 5
% pages = “1299 -- 1319“
% year = 1998}
% This file can be downloaded from http://www.kernel-machines.org.
% Last modified: 4 July 2003
% parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
rbf_var = 0.1;
xnum = 4;
ynum = 2;
max_ev = xnum*ynum;
% (extract features from the first Eigenvectors)
x_test_num = 15;
y_test_num = 15;
cluster_pos = [-0.5 -0.2; 0 0.6; 0.5 0];
cluster_size = 30;
% generate a toy data set
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
num_clusters = size(cluster_pos1);
train_num = num_clusters*cluster_size;
patterns = zeros(train_num 2);
range = 1;
randn(‘seed‘ 0);
for i=1:num_clusters
patterns((i-1)*cluster_size+1:i*cluster_size1) = cluster_pos(i1)+0.1*randn(cluster_size1);
patterns((i-1)*cluster_size+1:i*cluster_size2) = cluster_pos(i2)+0.1*randn(cluster_size1);
end
test_num = x_test_num*y_test_num;
x_range = -range:(2*range/(x_test_num - 1)):range;
y_offset = 0.5;
y_range = -range+ y_offset:(2*range/(y_test_num - 1)):range+ y_offset;
[xs ys] = meshgrid(x_range y_range);
test_patterns(: 1) = xs(:);
test_patterns(: 2) = ys(:);
cov_size = train_num; % use all patterns to compute the covariance matrix
% carry out Kernel PCA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for i=1:cov_size
for j
相关资源
- HDB3码、AMI码的MATLAB实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- Matlab实现混沌系统的控制
- matlab实现电力系统潮流计算-PQ分解法
- ROC曲线 matlab实现
- OFDM通信系统matlab实现
- matlab实现对两幅图像的叠加
- 织物密度测量MATLAB实现
- BP神经网络实现手写数字识别matlab实现
- 自动寻峰谷算法matlab实现
- AR模型算法的matlab实现和实验分析
- Dijkstra最短路径算法的Matlab实现
- 随机梯度下降算法的MATLAB实现
- 数字信号处理及MATLAB实现__第二版__学
- Harris角点检测matlab实现
- matlab实现仿射加密解密
- Matlab实现的阿拉伯数字识别程序代码
- 用matlab实现RSA数字签名
- matlab实现RSA公钥密码体制
- VANET仿真,用matlab实现仿真测试的源码
- EMD matlab实现源码
- 贝叶斯分类器Matlab实现113478
- zw_支持向量机与朴素贝叶斯算法matl
- matlab实现的CCV颜色聚合向量
- matlab实现牛顿-拉夫逊法电力系统潮流
- 八数码问题的MATLAB实现启发式
- 无人驾驶车辆模型预测直线轨迹跟踪
- matlab实现单纯形法
- 使用matlab实现ICP点云匹配
- 灰色预测模型及Matlab实现附参考论文
评论
共有 条评论