kernelmatrix.m
来自「这个是支持向量聚类机用matlab编译的主程序和部分子程序」· M 代码 · 共 36 行
M
36 行
%=====================================================================
%
% KernelMatrix % ------------
%% Parameters: % Samples - Matrix, holds the data points.
% q - The width of the Gaussian kernel.
% % Return Value:
% K - The inner product of all samples' images pairs.
%
% The inner products of the points images
% represented by an appropriate Mercer Kernel:
% we use the Gaussian Kernel.
%%=====================================================================
function [K] = KernelMatrix(Samples,q)[attr,N] = size(Samples);% initialization - N*N matrixK = zeros(N);for i = 1:N for j = 1:N % Calculate the Gaussian Kernel for each data points' pair. K(i,j) = GaussianKernel(Samples(:,i),Samples(:,j),q); endend
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?