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

📄 dualmaxsparsevariance2.m.svn-base

📁 a function inside machine learning
💻 SVN-BASE
字号:
function b = dualMaxSparseVariance2(K, Kj, Y, Yj, kernelCols)
%A function to compute the maximum sparse variance vector between matrix
%K and vector y
%We just use the example with the highest absolute variance and select from
%only a few columns of the kernel matrix 

if (nargin ~= 5)
    fprintf('%s\n', help(sprintf('%s', mfilename)));
    error('Incorrect number of inputs - see above usage instructions.');
end

numExamples = size(Kj, 1); 
columnIndices = (1:numExamples)'; 

[variances, bs] = sparseVariances(K, Kj, Y, Yj, columnIndices); 

permutationVector = randperm(numExamples);
colIndices = permutationVector(1:kernelCols);
variances2 = variances(colIndices); 
[maxVariance, i] = max(variances2);

b = zeros(numExamples, 1);
b(colIndices(i)) = bs(colIndices(i));

⌨️ 快捷键说明

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