Join/Login

Business Software

Open Source Software

For Vendors

Blog

About

More

Articles

Create

SourceForge Podcast

Site Documentation

Subscribe to our Newsletter

Support Request

For Vendors Help Create Join Login

Business Software

Open Source Software

SourceForge Podcast

Resources

Articles

Case Studies

Blog

Menu

Help

Create

Join

Login

Home

Browse

The Simple SVM toolbox

Code

The Simple SVM toolbox Code

Brought to you by: gloosli

Summary

Files

Reviews

Support

Code

Menu ▾ ▴

Browse Commits

Browse Files

[r6]: / utils / kernel.m  Maximize  Restore  History

Download this file

128 lines (127 with data), 3.3 kB

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128

function d = kernel(type,param);

switch type

case 'rbf'

if length(param)<1

d.name = 'rbf';

d.sigma = 1;

else

d.name = 'rbf';

d.sigma = param(1);

end

case 'rbfmax'

if length(param)<1

d.name = 'rbfmax';

d.sigma = 1;

d.conv = 0.1;

else

d.name = 'rbfmax';

d.sigma = param(1);

d.conv = param(2);

end

case 'rbf1'

if length(param)<1

d.name = 'rbf1';

d.sigma = 1;

else

d.name = 'rbf1';

d.sigma = param(1);

end

case 'rbfconv'

if length(param)<1

d.name = 'rbfconv';

d.sigma = 1;

d.conv = 0.1;

elseif length(param)<2

d.name = 'rbfconv';

d.sigma = param(1);

d.conv = 0.1;

else

d.name = 'rbfconv';

d.sigma = param(1);

d.conv = param(2);

end

case 'ratio'

if length(param)<1

d.name = 'ratio';

d.sigma = 1;

else

d.name = 'ratio';

d.sigma = param(1);

end

case 'simq'

if length(param)<1

d.name = 'simq';

d.sigma = 1;

else

d.name = 'simq';

d.sigma = param(1);

end

case 'poly'

if length(param)<1

d.name = 'poly';

d.degree=3;

d.scale=1;

d.offset = 1;

elseif length(param)<2

d.name = 'poly';

d.degree = param(1);

d.scale=1;

d.offset = 1;

elseif length(param)<3

d.name = 'poly';

d.degree = param(1);

d.scale=param(2);

d.offset = 1;

else

d.name = 'poly';

d.degree = param(1);

d.scale=param(2);

d.offset =param(3);

end

case 'polynorm'

if length(param)<1

d.name = 'polynorm';

d.degree=3;

d.scale=1;

elseif length(param)<2

d.name = 'polynorm';

d.degree = param(1);

d.scale=1;

else

d.name = 'polynorm';

d.degree = param(1);

d.scale=param(2);

end

case 'epanech'

if length(param)<1

d.name = 'epanech';

d.sigma = 1;

else

d.name = 'epanech';

d.sigma = param(1);

end

case 'gauss'

if length(param)<1

d.name = 'gauss';

d.sigma = 1;

else

d.name = 'gauss';

d.sigma = param(1);

end

case 'tanh'

if length(param)<1

d.name = 'tanh';

d.a = 0.1;

d.r = -0.1;

elseif length(param)<2

d.name = 'tanh';

d.a = param(1);

d.r = -0.1;

else

d.name = 'tanh';

d.a = param(1);

d.r = param(2);

end

otherwise

error('unknown kernel');

end

SourceForge

Create a Project

Open Source Software

Business Software

Top Downloaded Projects

Company

About

Team

SourceForge Headquarters
225 Broadway Suite 1600
San Diego, CA 92101
+1 (858) 422-6466

Resources

Support

Site Documentation

Site Status

SourceForge Reviews

© 2025 Slashdot Media. All Rights Reserved.

Terms Privacy Opt Out Advertise

×
Want the latest updates on software, tech news, and AI?

Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.

Submit