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

📄 kdr.m

📁 一个非常经典的核统计学习工具箱。集成了kpca、kdr、ksri等。具有分类和回归双重功能。
💻 M
字号:
function [Info] = KDR(Label, Inst, strParam)
%==========================================================================
% Kernel Statistics 
%--------------------------------------------------------------------------
% Inputs:
% label       [m x 1] : training data class label or response
% inst        [m x n] : training data inputs
% strParam    [string]: parameters
%    -s               : statistic method. 0-PCA, 1-SIR                      (default:0)
%    -t               : kernel type. 0-linear, 1-polynomial, 2-radial basis (default:2)
%    -r               : ratio of random subset size to the full data size   (default:1)
%    -z               : number of slices                                    (default:20)
%                       If NumOfSlice >= 1, it represents NumOfSlice slices.
%                       If NumOfSlice = 0,  it extracts slices according to class labels.
%    -p               : number of principal components                      (default:1)
%                       If NumOfPC= r >= 1, it extracts the first r leading eigenvectors.
%                       If NumOfPC= r < 1, it extracts leading eigenvectors whose sum 
%                       of eigenvalues is greater than 100*r% of the total
%                       sum of eigenvalues
%    -g               : gamma in kernel function                            (default:0.1)
%    -d       [1 x 1] : degree of polynomial kernel                         (default:2)
%    -b       [1 x 1] : constant term of polynomial kernel                  (default:0)
%    -m       [1 x 1] : scalar factor of polynomial kernel                  (default:1)
%--------------------------------------------------------------------------
% Outputs:
% Info        [struct]: results of Kernel Statistics method
%   .PC       [? x ?] : principal components of data
%   .EV       [? x 1] : eigenvalues respect to the principal components
%   .Ratio    [1 x 1] : 
%   .RS       [? x n] : reduced set
%   .Space    [string]: the space of Kernel Statistics method
%   .Params   [struct]: parameters specified by the user in the inputs
%--------------------------------------------------------------------------

% setting up parameters
params.s=0; params.t=2; params.r=1; params.z=20; params.p=1; params.g=0.1; 
params.d=2; params.b=0; params.m=1; 
[pInd, pVal] = strread(strParam, '%s%f', 'delimiter', ' ');
for i=1:length(pInd)
    if(strcmp(pInd{i}, '-s'))
        % statistic method

⌨️ 快捷键说明

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