svkernel.m ( File view )

  • By 2010-08-12
  • View(s):7
  • Download(s):0
  • Point(s): 1
			function k = svkernel(ker,u,v)
%SVKERNEL kernel for Support Vector Methods
%  Usage: k = svkernel(ker,u,v)
%  Parameters: ker - kernel type
%              u,v - kernel arguments
%  Values for ker: 'linear'  -
%                  'poly'    - p1 is degree of polynomial
%                  'rbf'     - p1 is width of rbfs (sigma)
%                  'sigmoid' - p1 is scale, p2 is offset
%                  'spline'  -
%                  'bspline' - p1 is degree of bspline
%                  'fourier' - p1 is degree
%                  'erfb'    - p1 is width of rbfs (sigma)
%                  'anova'   - p1 is max order of terms
%  Author: Steve Gunn (

  if (nargin < 1) % check correct number of arguments
     help svkernel
    global p1 p2;

    % could check for correct number of args in here
    % but will slow things down further
    switch lower(ker)
      case 'linear'
        k = u*v';
      case 'poly'
        k = (u*v' + 1)^p1;
      case 'rbf'
        k = exp(-(u-v)*(u-v)'/(2*p1^2));
      case 'erbf'
        k = exp(-sqrt((u-v)*(u-v)')/(2*p1^2));
      case 'sigmoid'
        k = tanh(p1*u*v'/length(u) + p2);
      case 'fourier'
        z = sin(p1 + 1/2)*2*ones(length(u),1);
        i = find(u-v);
        z(i) = sin(p1 + 1/2)*(u(i)-v(i))./sin((u(i)-v(i))/2);
        k = prod(z);
      case 'spline'
        z = 1 + u.*v + (1/2)*u.*v.*min(u,v) - (1/6)*(min(u,v)).^3;
        k = prod(z);
      case 'bspline'
        z = 0;
        for r = 0: 2*(p1+1)
          z = z + (-1)^r*binomial(2*(p1+1),r)*(max(0,u-v + p1+1 - r)).^(2*p1 + 1);
        k = prod(z);
      case 'anovaspline1'
        z = 1 + u.*v + u.*v.*min(u,v) - ((u+v)/2).*(min(u,v)).^2 + 
(Please download the complete source code to view)
Expand> <Close

Want complete source code? Download it here

Point(s): 1

0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
compilemex.m314.00 B11-03-03|16:49
correctness.m1.72 kB16-09-00|20:26
dagsvmdemo.m3.14 kB11-03-03|14:58
demo.m4.12 kB12-02-03|13:20
licence.txt17.92 kB16-09-00|20:26
readme.txt2.93 kB16-09-00|20:32
display.m1.56 kB16-09-00|20:26
evaluate.m1.85 kB16-09-00|20:26
char.m1.66 kB16-09-00|20:26
polynomial.m2.23 kB16-09-00|20:26
@polynomial0.00 B22-04-06|08:46
fwd.m1.99 kB28-11-00|11:16
train.m2.40 kB28-11-00|11:16
pairwise.m2.32 kB16-09-00|20:26
@pairwise0.00 B22-04-06|08:46
fwd.m1.77 kB16-09-00|20:26
train.m2.05 kB16-09-00|20:26
maxwin.m2.32 kB16-09-00|20:26
@maxwin0.00 B22-04-06|08:46
display.m1.53 kB16-09-00|20:26
evaluate.m1.71 kB16-09-00|20:26
char.m1.55 kB16-09-00|20:26
linear.m1.93 kB16-09-00|20:26
@linear0.00 B22-04-06|08:46
fwd.m2.50 kB28-11-00|11:16
getnsv.m1.66 kB11-03-03|14:54
train.m2.12 kB28-11-00|11:16
dagsvm.m2.29 kB16-09-00|20:26
@dagsvm0.00 B22-04-06|08:46
manual.bbl1.14 kB16-09-00|20:26
manual.bib3.99 kB16-09-00|20:26
manual.aux1.21 kB16-09-00|20:26
manual.blg996.00 B16-09-00|20:26
manual.dvi7.30 kB16-09-00|20:26
manual.log5.05 kB16-09-00|20:26
manual.tex4.40 kB16-09-00|20:26
Makefile313.00 B16-09-00|20:26
manual.ps84.40 kB16-09-00|20:26
apalike.bst22.38 kB16-09-00|20:26
apalike.sty1.09 kB16-09-00|20:26
doc0.00 B22-04-06|08:46
iris.txt2.79 kB16-09-00|20:26
iris.names2.62 kB24-11-00|07:47
data0.00 B22-04-06|08:46
svctutor.m1.96 kB16-09-00|20:26
@svctutor0.00 B22-04-06|08:46
display.m2.01 kB16-09-00|20:26
fwd.m1.77 kB16-09-00|20:26
svc.m2.58 kB16-09-00|20:26
getkernel.m1.61 kB16-09-00|20:26
compact.m2.04 kB16-09-00|20:26
getbias.m1.59 kB16-09-00|20:26
.xialpha.m.swp12.00 kB16-09-00|20:29
strip.m2.00 kB16-09-00|20:26
getw.m1.55 kB16-09-00|20:26
getsv.m1.58 kB16-09-00|20:26
fixduplicates.m2.19 kB16-09-00|20:26
getnsv.m1.60 kB16-09-00|20:26
train.m1.71 kB16-09-00|20:26
xialpha.m2.87 kB16-09-00|20:26
@svc0.00 B22-04-06|08:46
InfCache.cpp2.34 kB16-09-00|20:26
smosvctutor.m2.06 kB16-09-00|20:26
Cache.h2.14 kB16-09-00|20:26
InfCache.h2.22 kB16-09-00|20:26
LrrCache.cpp4.28 kB17-11-00|13:34
compilemex.m1.76 kB31-01-03|09:19
SmoTutor.h2.75 kB16-09-00|20:26
smosvctrain.mexglx17.00 kB11-03-03|16:49
train.m3.02 kB16-09-00|20:26
SmoTutor.cpp10.02 kB17-11-00|13:33
LrrCache.h2.41 kB17-11-00|13:30
smosvctrain.cpp4.10 kB16-09-00|20:26
utils.hh1.45 kB16-09-00|20:26
@smosvctutor0.00 B22-04-06|08:46
r.m1.59 kB16-09-00|20:26
display.m1.56 kB16-09-00|20:26
rbf.m2.33 kB16-09-00|20:26
evaluate.c2.71 kB16-09-00|20:26
evaluate.m2.09 kB16-09-00|20:26
compilemex.m1.57 kB31-01-03|09:15
char.m1.67 kB16-09-00|20:26
evaluate.mexglx62.54 kB11-03-03|16:49
@rbf0.00 B22-04-06|08:46
svm_v0.55beta0.00 B22-04-06|08:46
binomial.m371.00 B19-09-97|08:35
centrefig.m144.00 B01-05-98|11:47
cmap.mat1.69 kB13-08-97|15:33
Contents.m1.08 kB07-08-98|16:24
newsvm.zip74.74 kB26-10-01|14:23
nobias.m457.00 B06-08-98|16:39
qp.dll48.00 kB26-10-01|14:21
README2.58 kB12-10-01|15:27
softmargin.m312.00 B21-04-98|21:25
svc.m2.62 kB21-08-98|12:03
svcerror.m837.00 B21-08-98|11:04
svcinfo.m1.20 kB10-03-98|16:14
svcoutput.m973.00 B21-04-98|21:24
svcplot.m3.04 kB12-10-01|01:50
svdatanorm.m1.27 kB23-06-98|11:09
svkernel.m2.55 kB11-10-01|15:44
svr.m3.89 kB21-08-98|15:36
svrerror.m1.17 kB21-08-98|10:33
svroutput.m711.00 B15-04-98|23:05
svrplot.m1.78 kB13-02-98|10:31
svtol.m401.00 B21-08-98|14:57
uiclass.m5.26 kB18-11-97|17:15
uiclass.mat12.30 kB18-11-97|17:15
uiregress.m5.50 kB27-09-97|22:42
uiregress.mat11.37 kB12-10-98|13:24
Makefile27.00 B11-10-01|15:14
pr_loqo.c16.34 kB11-10-01|15:14
pr_loqo.h2.33 kB11-10-01|15:14
qp.c7.08 kB11-10-01|15:14
qp.dll48.00 kB26-10-01|14:21
Optimiser0.00 B22-04-06|08:46
example.mat744.00 B07-11-97|15:15
sinc.mat1.03 kB20-08-97|15:01
titanium.mat1.07 kB27-09-97|23:30
Regression0.00 B22-04-06|08:46
iris1v23.mat2.63 kB28-09-97|16:24
iris2v13.mat2.63 kB28-09-97|16:25
iris3v12.mat2.63 kB28-09-97|16:25
linsep.mat672.00 B06-11-97|15:46
nlinsep.mat712.00 B06-11-97|15:49
Classification0.00 B22-04-06|08:46
Examples0.00 B22-04-06|08:46
svm(推荐)0.00 B22-04-06|08:46
SVM工具箱0.00 B22-04-06|08:46
Sponsored links

svkernel.m (287.68 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point


Don't have an account? Register now
Need any help?
Mail to:


CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D